rails group by 分组

OrderStatus.where(:order_id=>72).group(:value).all.size

原文地址:https://www.cnblogs.com/lexus/p/1901144.html