Sha256: 0deec9af360714dcc17399878390759e5a262138da8d0546b576e37561d50e3f

Contents?: true

Size: 724 Bytes

Versions: 1

Compression:

Stored size: 724 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

    # 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

1 entries across 1 versions & 1 rubygems

Version Path
phcdevworks_members-9.0.0 app/models/phcdevworks_members/directory/category.rb