我有一个我创建的排行榜:
QuizuserAnswer.all(:include =>:user, :select => 'user_id, SUM(answer) AS points', :group =>'user_id', :order=>'points DESC'
这会返回一个像这样的对象:
=> [#<QuizuserAnswer user_id: 340>, #<QuizuserAnswer user_id: 348>]
现在我想找到一个特定用户的排行榜位置。有干净的方法吗?还是我必须遍历所有列?