Sha256: da38f5ad08373cb550ed3842fc340dfad8239493415e06d8b75c2f808d3369a6
Contents?: true
Size: 783 Bytes
Versions: 3
Compression:
Stored size: 783 Bytes
Contents
module Cmor::Cms class Page < ActiveRecord::Base # add shared behaviour for database backed templates include Cmor::Cms::Models::DatabaseTemplateConcern # associations has_many :navigation_items, dependent: :nullify has_many :content_blocks, dependent: :destroy, inverse_of: :page accepts_nested_attributes_for :content_blocks, allow_destroy: true # publishing include ActsAsPublished::ActiveRecord acts_as_published # callbacks after_save :touch_navigation_items # validations validates :title, presence: true def home_page? pathname == '/' && basename == 'home' end def touch_navigation_items navigation_items.map(&:update_url_form_page!) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
cmor_cms-0.0.60.pre | app/models/cmor/cms/page.rb |
cmor_cms-0.0.59.pre | app/models/cmor/cms/page.rb |
cmor_cms-0.0.58.pre | app/models/cmor/cms/page.rb |