I’m sorry I couldn’t find a lighter title for what I come up with.
The thing is I need to group some stuff by date, but not time. That’s to say I want them grouped by days, problem comes when grouping by created_at field, because it gets to seconds precision:
@stuff = SomeCoolStuff.where(cool_guy_id: @guy.id).group_by(&:created_at)
This gives me this kind of key for the hash: 2012-10-02 08:16:13 +0200, but what I want in the keys is only 2012-10-02.
Any thoughts?
Thanks in advance.
So I finally figured it out myself, for whoever may be interested this is the way I eneded up with: