ok so i have
>> list = Request.find_all_by_artist(\"someBand\")
=> [#
Time
is a quite complex object to group by. Assuming you want to group by the creation date, instead of the full Time
, start creating a custom method in your model to return the group criteria.
The method should return the creation date, possibly as string.
def group_by_criteria
created_at.to_date.to_s(:db)
end
Then, group by that method.
list.group_by(&:group_by_criteria).map {|k,v| [k, v.length]}.sort