Sha256: 59eaca2d866375e717c2e21e4a0f5e1bf6cc3ddce2d9fc87fbdf6c0b859d1223

Contents?: true

Size: 882 Bytes

Versions: 5

Compression:

Stored size: 882 Bytes

Contents

module PagesCms
  class PageBlock < ActiveRecord::Base
    belongs_to  :page
    belongs_to  :image #todo why is this here?

    has_many    :text_boxes,      dependent: :destroy
    has_many    :thumbnails,      dependent: :destroy
    has_many    :blog_feeds,      dependent: :destroy
    has_many    :image_boxes,     dependent: :destroy
    has_many    :contact_fields,  dependent: :destroy

    accepts_nested_attributes_for :text_boxes,      reject_if: :all_blank, allow_destroy: true
    accepts_nested_attributes_for :thumbnails,      reject_if: :all_blank, allow_destroy: true
    accepts_nested_attributes_for :blog_feeds,      reject_if: :all_blank, allow_destroy: true
    accepts_nested_attributes_for :image_boxes,     reject_if: :all_blank, allow_destroy: true
    accepts_nested_attributes_for :contact_fields,  reject_if: :all_blank, allow_destroy: true

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pages_cms-1.2.3 app/models/pages_cms/page_block.rb
pages_cms-1.2.2 app/models/pages_cms/page_block.rb
pages_cms-1.2.1 app/models/pages_cms/page_block.rb
pages_cms-1.2.0 app/models/pages_cms/page_block.rb
pages_cms-1.1.0 app/models/pages_cms/page_block.rb