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