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-23.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-22.2.0 app/models/phcpresspro/modules/category.rb
phcpresspro-22.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-22.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-21.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-21.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-20.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-19.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-18.4.0 app/models/phcpresspro/modules/category.rb
phcpresspro-18.3.0 app/models/phcpresspro/modules/category.rb
phcpresspro-18.2.0 app/models/phcpresspro/modules/category.rb
phcpresspro-18.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-18.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-17.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-16.2.0 app/models/phcpresspro/modules/category.rb
phcpresspro-16.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-16.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-15.6.0 app/models/phcpresspro/modules/category.rb
phcpresspro-15.5.0 app/models/phcpresspro/modules/category.rb
phcpresspro-15.4.0 app/models/phcpresspro/modules/category.rb