title: Grouping by week/month/etc & ActiveRecord?
body: <p>I'm doing some statics calculation in my product.  A user has performed a number of operations, let's say posted comments.  I want to be able to show them how many comments they've posted per week for the past month, or per month for the past year.  </p>
  
  <p>Is there any way with activerecord to group this way?  Is my best best to simply do this manually - to iterate over the records summing based on my own criteria?</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_many :comments
  end
  
  class Comments &lt; ActiveRecord::Base
    belongs_to :user
  end
  
  @user.comments(:all).map {|c| ...do my calculations here...}
  </code></pre>
  
  <p>or is there some better way?</p>
  
  <p>thanks!
  Oren</p>