Class: RedirectPageModelMigration

Inherits:
Migration
  • Object
show all
Defined in:
lib/migrations/yodel/13_redirect_page_model.rb

Class Method Summary collapse

Class Method Details

.down(site) ⇒ Object



10
11
12
# File 'lib/migrations/yodel/13_redirect_page_model.rb', line 10

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

.up(site) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/migrations/yodel/13_redirect_page_model.rb', line 2

def self.up(site)
  site.pages.create_model :redirect_page do |redirect_pages|
    add_field :url, :string, searchable: false
    add_one   :page, show_blank: true, blank_text: 'None'
    redirect_pages.record_class_name = 'RedirectPage'
  end
end