Sha256: 2bd68e253f58f20ee734b323d2d3ed7bd5c4b1e7c5bc1a3ce92da34963a70ddd

Contents?: true

Size: 701 Bytes

Versions: 19

Compression:

Stored size: 701 Bytes

Contents

module PhcdevworksTutorials
  class Tutorial::Category < ApplicationRecord

    # Clean URL Initialize
    extend FriendlyId

    # Paper Trail Initialize
    has_paper_trail :class_name => 'PhcdevworksTutorials::TutorialCategoryVersions'

    #Relationships
    has_and_belongs_to_many :posts, class_name: "Tutorial::Post", :join_table => "phcdevworks_tutorials_categories_posts", :dependent => :destroy

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

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

    def phcdev_tutorials_category_nice_urls
      [:category_name]
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
phcdevworks_tutorials-6.6.2 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-6.6.1 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-6.6.0 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-6.5.0 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-6.4.0 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-6.3.1 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-6.3.0 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-6.2.0 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-6.1.0 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-6.0.0 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-5.2.2 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-5.2.1 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-5.2.0 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-5.1.2 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-5.1.1 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-5.1.0 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-5.0.2 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-5.0.1 app/models/phcdevworks_tutorials/tutorial/category.rb
phcdevworks_tutorials-5.0.0 app/models/phcdevworks_tutorials/tutorial/category.rb