title: Rails Group data and render as json
body: <p>I have a User model with many coupons. Each coupon has a value. </p>
  
  <p>I would like to retrieve some data about all the user coupons, like the sum of the value of all the coupons for each user. I also would like to group data by day.</p>
  
  <p>How can I do this?</p>