Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: c19beacae3
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (23 sloc) 0.672 kB
class ExtendPages < ActiveRecord::Migration
class Page < ActiveRecord::Base
end
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.order('updated_at ASC').each_with_index{ |page,index|
page.update_attribute(:position, index + 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
Jump to Line
Something went wrong with that request. Please try again.