Easy and performant aggregations with rails