Rails Association Question...
- by keruilin
I have three models: User, RaceWeek, Race
#
Current associations:
User has_many race_weeks; RaceWeek belongs to user; RaceWeek has many races; Race belongs to RaceWeek
#
So the user_id is a foreign key in RaceWeek and race_week_id is a foreign key in Race.
#
fastest_time is an attribute of the Race model.
#
QUESTION: What's the optimal way to retrieve a list of users who have the top X fastest race times?