Let's say that in my "users" table I have a column called "points"
that is indexed. I would like to be able to query the position of any
given user within that index. In other words, I want the same data
that the following method would give:
def rank
result = 0
User.find(:all).each {|u| result=result+1 if u.points > points}
result
end
However I can't use the above method because the user database has a
quarter of a million records and is growing.