Sha256: ab59301064d54c45bb9483f8b977f7f1448ad0f7c1d13e6816fdedb2f247b77b

Contents?: true

Size: 739 Bytes

Versions: 85

Compression:

Stored size: 739 Bytes

Contents

module Phcpresspro
  class Modules::Category < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Add Paper Trail
    has_paper_trail :class_name => 'Phcpresspro::CategoryVersions'

    # Relationships
    has_many :connections, class_name: 'Phcpresspro::Modules::Connection', dependent: :destroy
    has_many :posts, class_name: 'Phcpresspro::Modules::Category', :through => :connections

    # Validation for Form Fields
    validates :catname,
      presence: true,
      length: { minimum: 3 }

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

    # Define for Multiple Records
    def phcpresspro_category_slug
      [
        [:catname]
      ]
    end

  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
phcpresspro-36.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-36.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-35.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-34.0.1 app/models/phcpresspro/modules/category.rb
phcpresspro-34.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-33.0.2 app/models/phcpresspro/modules/category.rb
phcpresspro-33.0.1 app/models/phcpresspro/modules/category.rb
phcpresspro-33.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-32.0.1 app/models/phcpresspro/modules/category.rb
phcpresspro-32.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-31.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-31.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-30.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-29.0.1 app/models/phcpresspro/modules/category.rb
phcpresspro-29.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-28.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-27.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-25.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-24.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-23.1.0 app/models/phcpresspro/modules/category.rb