Sha256: 6ca65e66cdd752013b0cc6cbe636c54004ad1aa11d1a10a4692981a8adc04aae

Contents?: true

Size: 745 Bytes

Versions: 16

Compression:

Stored size: 745 Bytes

Contents

module PhcdevworksPress
  class Article::Category < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Paper Trail Initialize
    has_paper_trail :class_name => "PhcdevworksPress::ArticleCategoryVersions"

    # Relationships
    has_and_belongs_to_many :posts, class_name: "Article::Post", :join_table => "phcdevworks_press_categories_posts", :dependent => :destroy
    belongs_to :user, class_name: "PhcdevworksAccounts::User"

    # Form Fields Validation
    validates :category_name,
      presence: true,
      uniqueness: true

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

    def phcdev_article_category_nice_urls
      [:category_name]
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
phcdevworks_press-4.9.0 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-4.8.2 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-4.8.1 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-4.8.0 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-4.7.0 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-4.6.0 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-4.5.0 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-4.4.0 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-4.3.0 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-4.2.0 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-4.0.0 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-3.1.1 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-3.1.0 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-3.0.2 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-3.0.1 app/models/phcdevworks_press/article/category.rb
phcdevworks_press-3.0.0 app/models/phcdevworks_press/article/category.rb