Sha256: 3f217b8b848b1a3034e2ef3d7caee4eedbfa3606bc61b2d4d887405a327e7f88

Contents?: true

Size: 563 Bytes

Versions: 70

Compression:

Stored size: 563 Bytes

Contents

class AddDownForMaintenancePage < ActiveRecord::Migration
  def self.up
    page = Page.create(:title => "Down for maintenance", :menu_match => "^/maintenance$", :show_in_menu => false)
    page.parts.create(:title => "body", :body => "<p>Our site is currently down for maintenance. Please try back later.</p>")
  end

  def self.down
    page = Page.find_by_menu_match("^/maintenance$")
    unless page.nil?
      page.parts.delete_all
      page.update_attributes({:menu_match => nil, :link_url => nil, :deletable => true})
      page.destroy
    end
  end
end

Version data entries

70 entries across 70 versions & 2 rubygems

Version Path
refinerycms-0.9.5.27 db/migrate/20091130040711_add_down_for_maintenance_page.rb
refinerycms-0.9.5.26 db/migrate/20091130040711_add_down_for_maintenance_page.rb
refinerycms-0.9.5.25 db/migrate/20091130040711_add_down_for_maintenance_page.rb
refinerycms-0.9.5.24 db/migrate/20091130040711_add_down_for_maintenance_page.rb
refinerycms-0.9.5.23 db/migrate/20091130040711_add_down_for_maintenance_page.rb
refinerycms-0.9.5.22 db/migrate/20091130040711_add_down_for_maintenance_page.rb
refinerycms-0.9.5.21 db/migrate/20091130040711_add_down_for_maintenance_page.rb
refinerycms-0.9.5.20 db/migrate/20091130040711_add_down_for_maintenance_page.rb
refinerycms-0.9.5.19 db/migrate/20091130040711_add_down_for_maintenance_page.rb
refinerycms-0.9.5.18 db/migrate/20091130040711_add_down_for_maintenance_page.rb