Sha256: eb7090b8019d676d81fb0745a3795ce82cea6beba7643a7e07428e9742c9c841
Contents?: true
Size: 614 Bytes
Versions: 6
Compression:
Stored size: 614 Bytes
Contents
class ExtendPages < ActiveRecord::Migration def self.up change_table :pages do |t| t.boolean :show_in_header, :default => false, :null => false t.boolean :show_in_footer, :default => false, :null => false t.string :foreign_link t.integer :position, :default => 1, :null => false Page.all(:order => "updated_at ASC").each_with_index{|page,x| page.update_attribute(:position, x+1)} end end def self.down change_table :pages do |t| t.remove :show_in_header t.remove :show_in_footer t.remove :foreign_link t.remove :position end end end
Version data entries
6 entries across 6 versions & 1 rubygems