I know I\'ve seen this before but I can\'t find anything now. I want to group a query by a certain column and be able to display how many are in each group. I got the first part
After this commit:
https://github.com/rails/rails/commit/a1c05dd8b9bd3623289d3aa73dda2943d620cc34
there's a new way to do the same thing:
@project.line_items.count(:group => LineItem.arel_table[:device_id])