title: Bound activerecords-queries using aggregate funcs (sum, avg,...) with limit
body: <p>Given this pseudo-query:</p>
  
  <pre><code>Model.sum(:column, :condition =&gt; ['id = ?', id], order =&gt; "date DESC", :limit =&gt; X)
  </code></pre>
  
  <p>Here we have the problem that the sum obtained is not "limited" by the value X (it takes as sum all values on the column instead that the sum of the X (firsts) entries). </p>
  
  <p>It seems that the <code>limit</code> is taken after calculating the aggregate func <code>sum</code>.</p>
  
  <p>How can I get the sum only limited by the firsts X entries?</p>