Sha256: 75292f9f00d20661f7ff1523424627f7284eb112028a24160dc74333e7799470

Contents?: true

Size: 688 Bytes

Versions: 14

Compression:

Stored size: 688 Bytes

Contents

module Phcpresspro
  class Article::Category < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

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

    # Relationships
    has_and_belongs_to_many :posts, class_name: 'Phcpresspro::Article::Post', :join_table => 'categories_posts'

    # Validation for Form Fields
    validates :catname,
      presence: true,
      uniqueness: 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

14 entries across 14 versions & 1 rubygems

Version Path
phcpresspro-80.0.0 app/models/phcpresspro/article/category.rb
phcpresspro-79.0.0 app/models/phcpresspro/article/category.rb
phcpresspro-78.2.0 app/models/phcpresspro/article/category.rb
phcpresspro-78.1.0 app/models/phcpresspro/article/category.rb
phcpresspro-78.0.0 app/models/phcpresspro/article/category.rb
phcpresspro-77.0.0 app/models/phcpresspro/article/category.rb
phcpresspro-76.0.0 app/models/phcpresspro/article/category.rb
phcpresspro-75.0.0 app/models/phcpresspro/article/category.rb
phcpresspro-74.0.0 app/models/phcpresspro/article/category.rb
phcpresspro-73.0.0 app/models/phcpresspro/article/category.rb
phcpresspro-72.0.0 app/models/phcpresspro/article/category.rb
phcpresspro-71.0.0 app/models/phcpresspro/article/category.rb
phcpresspro-70.2.0 app/models/phcpresspro/article/category.rb
phcpresspro-70.1.0 app/models/phcpresspro/article/category.rb