Sha256: ab59301064d54c45bb9483f8b977f7f1448ad0f7c1d13e6816fdedb2f247b77b
Contents?: true
Size: 739 Bytes
Versions: 85
Compression:
Stored size: 739 Bytes
Contents
module Phcpresspro class Modules::Category < ApplicationRecord # Clean URL Initialize extend FriendlyId # Add Paper Trail has_paper_trail :class_name => 'Phcpresspro::CategoryVersions' # Relationships has_many :connections, class_name: 'Phcpresspro::Modules::Connection', dependent: :destroy has_many :posts, class_name: 'Phcpresspro::Modules::Category', :through => :connections # Validation for Form Fields validates :catname, presence: 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
85 entries across 85 versions & 1 rubygems