Override groupdate Gem in Rails to return a hash of hashes
<p>I am using the <a href="https://github.com/ankane/groupdate" rel="nofollow noreferrer">groupdate gem</a> to group Events by day on event_start_time, which is a Rails datetime object. Is there anyway I can override the <code>group_by_day</code> function to return a hash with hashes containing the Event objects.</p>
<p>As per the documentation this is the hash you get when grouping by day.</p>
<blockquote>
<pre><code>User.group_by_day(:created_at).count
    # {
    #   2013-04-16 00:00:00 UTC =&gt; 50,
    #   2013-04-17 00:00:00 UTC =&gt; 100,
    #   2013-04-18 00:00:00 UTC =&gt; 34
    # }
</code></pre>
</blockquote>
<p>What if instead I want to return a hash like the example below.</p>
<blockquote>
<pre><code>User.group_by_day(:created_at).count
    {
    2013-04-16 00:00:00 UTC =&gt; { id: &quot;1&quot;, location: &quot;Sf&quot;,.., },
    2013-04-17 00:00:00 UTC =&gt; { id: &quot;40&quot;, location: &quot;Gt&quot;,.., },
    2013-04-18 00:00:00 UTC =&gt; { id: &quot;100&quot;, location: &quot;SD&quot;,..,}
    }
</code></pre>
</blockquote>
<p>In my view I would like to display these grouped by day Events. Thanks in advance.</p>