I am trying to build a high score list of 5 entries per game level, but with only at most 1 entry per player per level. The following did not work:
@levels = Level.find(:all, :select => 'distinct user_id', :include => [:user], :conditions => ["level_number = ?", params[:level]], :order => "moves, time", :limit => 5)
User_id is the column that identifies each player in the db. A player can have many entries per level (all games are saved), but I only want to show each person once on the list.