Sha256: 3c1e65bf3c1a46692e6e7f0f87ef08bbc5bbdd34b4ce6e5cd1d28b8705a678f5
Contents?: true
Size: 649 Bytes
Versions: 5
Compression:
Stored size: 649 Bytes
Contents
module Phcpress class Article::Category < ApplicationRecord # Clean URL Initialize extend FriendlyId # Paper Trail Initialize has_paper_trail :class_name => 'Phcpress::CategoryVersions' # Relationships has_and_belongs_to_many :posts, class_name: 'Phcpress::Article::Post', :join_table => 'categories_posts', :dependent => :destroy belongs_to :user, class_name: 'PhcdevworksAccountsDevise::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
5 entries across 5 versions & 1 rubygems