我在我的模型中使用范围,比如
scope :by_average_rating_than_no_of_rating, :order => 'average_rating DESC,number_of_ratings DESC,editors_pick DESC'
但我想达到如下结果
scope :by_average_rating_than_no_of_rating, :order => 'average_rating DESC,count(number_of_ratings) DESC,editors_pick DESC'
我如何按顺序对模型属性应用计数?
有什么帮助吗?
谢谢