Hi,
I am trying to get number of events of by a certain person in a time period.
My activerecord syntax is: Event.count(:group => [ 'DATE(created_at), user_id' ]) This returns something like: => [["1", 3], ["3", 1], ["4", 2], ["5", 1]]
It should have an extra date field there. Running the logged query directly in mysql returns the proper result:
SELECT count(*) AS count_all, DATE(created_at), user_id AS date_created_at_user_id FROM `events` GROUP BY DATE(created_at), user_id