Sha256: c0473baa187b89a7cb39b3a2c04fa83afa47eb7b9e226af5aa7016abb98fffac

Contents?: true

Size: 721 Bytes

Versions: 55

Compression:

Stored size: 721 Bytes

Contents

module Phcpress
  class Modules::Category < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

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

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

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

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

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

  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
phcpress-50.0.0 app/models/phcpress/modules/category.rb
phcpress-49.0.0 app/models/phcpress/modules/category.rb
phcpress-48.0.0 app/models/phcpress/modules/category.rb
phcpress-47.1.0 app/models/phcpress/modules/category.rb
phcpress-47.0.0 app/models/phcpress/modules/category.rb
phcpress-46.0.0 app/models/phcpress/modules/category.rb
phcpress-45.0.0 app/models/phcpress/modules/category.rb
phcpress-44.0.0 app/models/phcpress/modules/category.rb
phcpress-43.0.0 app/models/phcpress/modules/category.rb
phcpress-42.0.0 app/models/phcpress/modules/category.rb
phcpress-41.0.0 app/models/phcpress/modules/category.rb
phcpress-40.0.0 app/models/phcpress/modules/category.rb
phcpress-39.0.0 app/models/phcpress/modules/category.rb
phcpress-38.0.0 app/models/phcpress/modules/category.rb
phcpress-37.0.0 app/models/phcpress/modules/category.rb
phcpress-36.0.0 app/models/phcpress/modules/category.rb
phcpress-35.0.0 app/models/phcpress/modules/category.rb
phcpress-34.0.0 app/models/phcpress/modules/category.rb
phcpress-33.0.0 app/models/phcpress/modules/category.rb
phcpress-32.0.0 app/models/phcpress/modules/category.rb