Sha256: 1e77e91e45c9a95b83098d1663fb16f382e3c630d543c0a4f45c91b29638be27
Contents?: true
Size: 686 Bytes
Versions: 8
Compression:
Stored size: 686 Bytes
Contents
module Phcpresspro class Article::Category < ApplicationRecord # Clean URL Initialize extend FriendlyId # Paper Trail Initialize has_paper_trail :class_name => 'Phcpresspro::CategoryVersions' # Relationships has_and_belongs_to_many :posts, class_name: 'Phcpresspro::Article::Post', :join_table => 'categories_posts', :dependent => :destroy belongs_to :user, class_name: 'Phcaccountspro::User' # Form Fields Validation validates :category_name, presence: true, uniqueness: true # Clean URL Define friendly_id :phc_nice_url_slug, use: [:slugged, :finders] def phc_nice_url_slug [:category_name] end end end
Version data entries
8 entries across 8 versions & 1 rubygems