title: rails - group by day as well as hour
body: <p>I want to create an array of the number of items created each hour, each day.</p>
  
  <p>I'm tracking how people are feeling, so my model is called <code>TrackMood</code> It just has a column called <code>mood</code> and the timestamps.</p>
  
  <p>If I do</p>
  
  <pre><code>TrackMood.where(mood: "good").group("hour(created_at)").count
  </code></pre>
  
  <p>I get something like
      {11=>4, 12=>2, 13=>2, 15=>1} </p>
  
  <p>I've got 2 issues here</p>
  
  <p>1 How do I add the day into this so it doesn't just add the items created yesterday at 11 o'clock to the items added today at 11 o'clock?</p>
  
  <p>2 How do I make sure it says <code>0</code> for hours when nothing is created?</p>