Sha256: 6b61ba8fd0c7c5ec96a4167d84789f8bb63f992e0ad8f629759510b28c568391

Contents?: true

Size: 860 Bytes

Versions: 4

Compression:

Stored size: 860 Bytes

Contents

module PhcdevworksMembers
  class Directory::Category < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Paper Trail Initialize
    has_paper_trail :class_name => "PhcdevworksMembers::DirectoryCategoryVersions"

    # Relationships
    has_and_belongs_to_many :listings, class_name: "PhcdevworksMembers::Member::Listing", :join_table => "phcdevworks_members_categories_lstings", :dependent => :destroy
    belongs_to :optimization, class_name: "PhcdevworksCoreModules::Marketing::Optimization", optional: true

    # Form Fields Validation
    validates :directory_category_name,
      presence: true

    # Clean URL Define
    friendly_id :directory_category_nice_urls, use: [:slugged, :finders]

    def directory_category_nice_urls
      [
        [:directory_category_name]
      ]
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
phcdevworks_members-12.0.2 app/models/phcdevworks_members/directory/category.rb
phcdevworks_members-12.0.1 app/models/phcdevworks_members/directory/category.rb
phcdevworks_members-12.0.0 app/models/phcdevworks_members/directory/category.rb
phcdevworks_members-11.2.0 app/models/phcdevworks_members/directory/category.rb