I\'m doing some statics calculation in my product. A user has performed a number of operations, let\'s say posted comments. I want to be able to show them how many comment
In this case, the best solution for me was to either do it in straight SQL, or to use the Ruby group_by function:
@user.all.group_by{ |u| u.created_at.beginning_of_month }