Permalink
Browse files

Merge pull request #24 from parndt/refactor

Work in progress refactor
  • Loading branch information...
2 parents ded5ea1 + af11630 commit a6873a60dd60bde3b057b9979f41a8c2566d07c2 @GeekOnCoffee GeekOnCoffee committed Apr 17, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 db/migrate/20090625125735_extend_pages.rb
@@ -5,8 +5,9 @@ def self.up
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)}
-
+ Page.order('updated_at ASC').each_with_index{ |page,index|
+ page.update_attribute(:position, index + 1)
+ }
end
end

0 comments on commit a6873a6

Please sign in to comment.