title: Count records by date returning zero values
body: <p>I am trying to find a way to output the number of records of each day between two given dates:</p>
  
  <pre><code>from = 7.days.ago.to_date
  to = Date.today
  total = Records.where(created_at: from..to).group("date(created_at)").count
  list = total.values
  </code></pre>
  
  <p>There is just the problem that when in some dates are no records, it wouldn't be displayed, would be just ignored.</p>
  
  <p>So instead of this:</p>
  
  <pre><code>list = [0,4,3,0,3,0,1]
  </code></pre>
  
  <p>I get this:</p>
  
  <pre><code>list = [4,3,3,1]
  </code></pre>
  
  <p>Well, I think I understand why I get it so, because of querying records and not dates after all.</p>
  
  <p>I could do a loop <code>from.upto(to)</code> and on <code>each</code> one <code>do</code> a query to the DB, get those counts and build so my little list —or something else very <em>dirty</em>— but, is there a more clean solution not involving lots of queries?</p>