Sha256: 621e570005f7dacdc83ecff13375bdd34d910aafd5d900a273af115079072eb7

Contents?: true

Size: 588 Bytes

Versions: 11

Compression:

Stored size: 588 Bytes

Contents

module Phcmembers
	class Directory::Category < ApplicationRecord

    # Clean URL Initialize
		extend FriendlyId

		# Paper Trail Initialize
		has_paper_trail :class_name => 'Phcmembers::CategoryVersions'

    # Relationships
		has_and_belongs_to_many :listings, class_name: 'Phcmembers::Member::Listing', :join_table => 'categories_listings', :dependent => :destroy

    # Form Fields Validation
		validates :category_name,
			presence: 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

11 entries across 11 versions & 1 rubygems

Version Path
phcmembers-68.0.3 app/models/phcmembers/directory/category.rb
phcmembers-68.0.2 app/models/phcmembers/directory/category.rb
phcmembers-68.0.1 app/models/phcmembers/directory/category.rb
phcmembers-68.0.0 app/models/phcmembers/directory/category.rb
phcmembers-67.5.0 app/models/phcmembers/directory/category.rb
phcmembers-67.4.0 app/models/phcmembers/directory/category.rb
phcmembers-67.3.0 app/models/phcmembers/directory/category.rb
phcmembers-67.1.0 app/models/phcmembers/directory/category.rb
phcmembers-67.0.0 app/models/phcmembers/directory/category.rb
phcmembers-66.0.0 app/models/phcmembers/directory/category.rb
phcmembers-65.0.0 app/models/phcmembers/directory/category.rb