Sha256: 5e0837cba65651e843f749f25fcf9d48b324607f3a89614eacc8cfa1e155236f

Contents?: true

Size: 597 Bytes

Versions: 12

Compression:

Stored size: 597 Bytes

Contents

module Phcmemberspro
	class Directory::Category < ApplicationRecord

    # Clean URL Initialize
		extend FriendlyId

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

    # Relationships
		has_and_belongs_to_many :listings, class_name: 'Phcmemberspro::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

12 entries across 12 versions & 1 rubygems

Version Path
phcmemberspro-92.0.3 app/models/phcmemberspro/directory/category.rb
phcmemberspro-92.0.2 app/models/phcmemberspro/directory/category.rb
phcmemberspro-92.0.1 app/models/phcmemberspro/directory/category.rb
phcmemberspro-92.0.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-91.4.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-91.3.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-91.2.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-91.1.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-91.0.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-90.0.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-89.0.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-88.0.0 app/models/phcmemberspro/directory/category.rb