Sha256: ab4f0cbcedc62cbe94bed68e8ee919816685aff5e092a2a36f1d47eb2192164a

Contents?: true

Size: 658 Bytes

Versions: 8

Compression:

Stored size: 658 Bytes

Contents

module Phcmemberspro
  class Directory::Category < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Add Paper Trail
    has_paper_trail

    # Model Relationships
    has_many :categorylistings, class_name: 'Phcmemberspro::Directory::Categorylisting', dependent: :destroy
    has_many :listings, class_name: 'Phcmemberspro::Member::Listing', :through => :categorylistings

    validates :catname,
    length: { minimum: 3 }

    # Clean URL Define
    friendly_id :phcmembers_category_slug, use: :slugged

    # Define for Multiple Records
    def phcmembers_category_slug
      [
        [:id, :catname]
      ]
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
phcmemberspro-20.5.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-20.4.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-20.3.1 app/models/phcmemberspro/directory/category.rb
phcmemberspro-20.3.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-20.2.2 app/models/phcmemberspro/directory/category.rb
phcmemberspro-20.2.1 app/models/phcmemberspro/directory/category.rb
phcmemberspro-20.2.0 app/models/phcmemberspro/directory/category.rb
phcmemberspro-20.1.0 app/models/phcmemberspro/directory/category.rb