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-50.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-49.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-48.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-47.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-47.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-46.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-44.2.0 app/models/phcpresspro/modules/category.rb
phcpresspro-44.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-44.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-43.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-42.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-41.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-40.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-40.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-39.0.1 app/models/phcpresspro/modules/category.rb
phcpresspro-39.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-38.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-37.1.0 app/models/phcpresspro/modules/category.rb
phcpresspro-38.0.0 app/models/phcpresspro/modules/category.rb
phcpresspro-37.0.0 app/models/phcpresspro/modules/category.rb