Class: RecordProxyPageModelMigration

Inherits:
Migration
  • Object
show all
Defined in:
lib/migrations/yodel/10_record_proxy_page_model.rb

Class Method Summary collapse

Class Method Details

.down(site) ⇒ Object



14
15
16
# File 'lib/migrations/yodel/10_record_proxy_page_model.rb', line 14

def self.down(site)
  site.record_proxy_pages.destroy
end

.up(site) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/migrations/yodel/10_record_proxy_page_model.rb', line 2

def self.up(site)
  site.pages.create_model :record_proxy_pages do |record_proxy_pages|
    add_one   :record_model, model: :model
    add_one   :after_create_page, model: :page
    add_one   :after_delete_page, model: :page
    add_one   :after_update_page, model: :page
    add_field :show_record_layout, :string
    add_one   :show_record_layout_record, model: :layout, display: false
    record_proxy_pages.record_class_name = 'RecordProxyPage'
  end
end