标签: ruby-on-rails ruby ruby-on-rails-3
鉴于我收到了此查询
@users = User.all
我也有@ users.received_likes.size
如何根据User.received_likes.size订购结果?
答案 0 :(得分:0)
@users = User.all.sort_by {|u| u.received_likes.size}