Sha256: 22a18ac162ea7790080cfb210e445e698bc4e361801c78898f1e40b35cadc568
Contents?: true
Size: 671 Bytes
Versions: 21
Compression:
Stored size: 671 Bytes
Contents
class RemoveTakeDownForMaintenancePage < ActiveRecord::Migration def self.up if (page = Page.find_by_menu_match("^/maintenance$")).present? page.destroy! end end def self.down down_for_maintenance_page = Page.create(:title => "Down for maintenance", :menu_match => "^/maintenance$", :show_in_menu => false, :position => (Page.maximum(:position) + 1)) down_for_maintenance_page.parts.create({ :title => "Body", :body => "<p>Our site is currently down for maintenance. Please try back later.</p>", :position => 0 }) end end
Version data entries
21 entries across 21 versions & 1 rubygems