Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #24 from parndt/refactor

Work in progress refactor
  • Loading branch information...
commit a6873a60dd60bde3b057b9979f41a8c2566d07c2 2 parents ded5ea1 + af11630
@GeekOnCoffee GeekOnCoffee authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 db/migrate/20090625125735_extend_pages.rb
View
5 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
Please sign in to comment.
Something went wrong with that request. Please try again.