Sha256: ff0605c2608fc6988c464cf04fb8c498187b4794aed62e5a582fe13ef7dddfe6

Contents?: true

Size: 734 Bytes

Versions: 20

Compression:

Stored size: 734 Bytes

Contents

module Ecm::Cms
  class Page::ContentBlock < ActiveRecord::Base
    # associations
    belongs_to :ecm_cms_content_box, class_name: 'ContentBox',
                                     foreign_key: 'ecm_cms_content_box_id'
    belongs_to :ecm_cms_page, class_name: 'Ecm::Cms::Page',
                              foreign_key: 'ecm_cms_page_id'

    # attributes
    attr_accessible(:body,
                    :ecm_cms_content_box_id) if Rails.version < '4.0.0'

    # validations
    validates :body, presence: true
    validates :ecm_cms_content_box, presence: true
    validates :ecm_cms_page, presence: true
    # validates :ecm_cms_page, :existence => true

    def content_box_name
      ecm_cms_content_box.name
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ecm_cms2-5.1.2 app/models/ecm/cms/page/content_block.rb
ecm_cms2-5.1.1 app/models/ecm/cms/page/content_block.rb
ecm_cms2-5.1.0 app/models/ecm/cms/page/content_block.rb
ecm_cms2-5.0.0 app/models/ecm/cms/page/content_block.rb
ecm_cms2-4.1.1 app/models/ecm/cms/page/content_block.rb
ecm_cms2-4.1.0 app/models/ecm/cms/page/content_block.rb
ecm_cms2-4.0.1 app/models/ecm/cms/page/content_block.rb
ecm_cms2-4.0.0 app/models/ecm/cms/page/content_block.rb
ecm_cms2-3.0.3 app/models/ecm/cms/page/content_block.rb
ecm_cms2-3.0.2 app/models/ecm/cms/page/content_block.rb
ecm_cms2-3.0.1 app/models/ecm/cms/page/content_block.rb
ecm_cms2-3.0.0 app/models/ecm/cms/page/content_block.rb
ecm_cms2-2.1.4 app/models/ecm/cms/page/content_block.rb
ecm_cms2-2.1.3 app/models/ecm/cms/page/content_block.rb
ecm_cms2-2.1.2 app/models/ecm/cms/page/content_block.rb
ecm_cms2-2.1.1 app/models/ecm/cms/page/content_block.rb
ecm_cms2-2.1.0 app/models/ecm/cms/page/content_block.rb
ecm_cms2-2.0.4 app/models/ecm/cms/page/content_block.rb
ecm_cms2-2.0.3 app/models/ecm/cms/page/content_block.rb
ecm_cms2-2.0.2 app/models/ecm/cms/page/content_block.rb