Ruby on Rails has_many minimun
Posted
by user273119
on Stack Overflow
See other posts from Stack Overflow
or by user273119
Published on 2010-05-18T06:03:14Z
Indexed on
2010/05/18
6:10 UTC
Read the original article
Hit count: 208
Look:
class User < ActiveRecord::Base
has_many :scores, :order => 'score DESC',:autosave =>true,
end
class Score < ActiveRecord::Base
belongs_to :user
end
Now, I want to order the users by the maximun score of each one,
The thing is that i need to get a user, two up and two down users
like a top 5 scores
how can I do that????
please is urgent!!
© Stack Overflow or respective owner