Sha256: 7b6bec2619c3a7721f2acb512245c9e51403f9cc621cef20bca7b6dd988a7341

Contents?: true

Size: 680 Bytes

Versions: 6

Compression:

Stored size: 680 Bytes

Contents

module Guts
  # Category model
  class Category < ActiveRecord::Base
    extend FriendlyId
    include NavigatableConcern
    include TrackableConcern
    include MultisiteScopeConcern
    
    validates :title, presence: true, length: { minimum: 3 }
    
    belongs_to :site
    has_many :categorizations
    has_many :tracks, as: :object
    has_many :contents, through: :categorizations
    has_many :media, as: :filable, dependent: :destroy
    has_many :metafields, as: :fieldable, dependent: :destroy
    
    friendly_id :title, use: [:slugged, :finders]
    navigatable :title, format: ':title'
    trackable :create, :update, :destroy, fields: [:title, :slug]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
guts-1.3.0 app/models/guts/category.rb
guts-1.2.2 app/models/guts/category.rb
guts-1.2.1 app/models/guts/category.rb
guts-1.2.0 app/models/guts/category.rb
guts-1.1.1 app/models/guts/category.rb
guts-1.1.0 app/models/guts/category.rb