title: How to sum columns and group by date column in Rails
body: <p>I have a model with following columns</p>
  
  <h2>Charges Model</h2>
  
  <pre><code>Date
  fee
  discount
  </code></pre>
  
  <h2>Data</h2>
  
  <pre><code>1/1/15, 1, 1
  1/1/15, 2, 1
  2/2/15, 3, 3
  </code></pre>
  
  <p>I have a few named scopes like this_year</p>
  
  <p>I want to do something like Charges.this_year.summed_up</p>
  
  <p>How do I make a named scope for this.</p>
  
  <h2>The returned response then should be:</h2>
  
  <pre><code>1/1/15, 3, 2
  2/2/15, 3, 3
  </code></pre>