Sha256: 662f65179c4c784964fd4ff695764b4a928046cb230b8636f02fa6da1b42c60c

Contents?: true

Size: 760 Bytes

Versions: 4

Compression:

Stored size: 760 Bytes

Contents

module Guts
  # Content model
  class Content < ActiveRecord::Base
    extend FriendlyId
    include NavigatableConcern
    include TrackableConcern
    
    validates :type, presence: true
    validates :title, presence: true, length: {minimum: 3}
    
    belongs_to :type
    belongs_to :user, required: false
    has_many :categorizations
    has_many :categories, through: :categorizations
    has_many :media, as: :filable, dependent: :destroy
    has_many :metafields, as: :fieldable, dependent: :destroy
    has_many :tracks, as: :object

    friendly_id :title, use: [:slugged, :finders]
    navigatable :"type.title", :title, format: "[:type.title] :title"
    trackable :create, :update, :destroy, fields: [:title, :visible, :tags, :slug]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
guts-1.0.8 app/models/guts/content.rb
guts-1.0.7 app/models/guts/content.rb
guts-1.0.5 app/models/guts/content.rb
guts-1.0.3 app/models/guts/content.rb