Sha256: 75292f9f00d20661f7ff1523424627f7284eb112028a24160dc74333e7799470
Contents?: true
Size: 688 Bytes
Versions: 14
Compression:
Stored size: 688 Bytes
Contents
module Phcpresspro class Article::Category < ApplicationRecord # Clean URL Initialize extend FriendlyId # Add Paper Trail has_paper_trail :class_name => 'Phcpresspro::CategoryVersions' # Relationships has_and_belongs_to_many :posts, class_name: 'Phcpresspro::Article::Post', :join_table => 'categories_posts' # Validation for Form Fields validates :catname, presence: true, uniqueness: true, length: { minimum: 3 } # Clean URL Define friendly_id :phcpresspro_category_slug, use: [:slugged, :finders] # Define for Multiple Records def phcpresspro_category_slug [ [:catname] ] end end end
Version data entries
14 entries across 14 versions & 1 rubygems