Sha256: cda69186c595d226e104b8cc3861a19fe6dab50c3458290b925479a6c6060130
Contents?: true
Size: 966 Bytes
Versions: 2
Compression:
Stored size: 966 Bytes
Contents
module Guts # Content model class Content < ActiveRecord::Base extend FriendlyId include NavigatableConcern include TrackableConcern include MultisiteScopeConcern validates :type, presence: true validates :title, presence: true, length: { minimum: 3 } belongs_to :site 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, :scoped, :finders], scope: :site_id navigatable :'type.title', :title, format: '[:type.title] :title' trackable :create, :update, :destroy, fields: [:title, :visible, :tags, :slug] # Updates slug if title changes # @return [Boolean] def should_generate_new_friendly_id? title_changed? end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
guts-1.4.0 | app/models/guts/content.rb |
guts-1.3.6 | app/models/guts/content.rb |