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-69.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-69.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-68.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-67.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-66.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-65.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-64.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-63.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-62.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-61.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-60.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-59.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-58.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-57.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-56.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-55.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-54.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-53.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-52.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-51.0.0 app/models/phcpresspro/modules/category.rb