Skip to content

Instantly share code, notes, and snippets.

@probablycorey
Created December 29, 2009 18:10
Show Gist options
  • Save probablycorey/265469 to your computer and use it in GitHub Desktop.
Save probablycorey/265469 to your computer and use it in GitHub Desktop.
users = User.find(:all, :sort => "previous_worth", :order => "DESC")
users.each_with_index do |u, i|
u.rank = i
if u.previous_worth <= worth
break
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment