title: ActiveRecord find_each combined with limit and order
body: <p>I'm trying to run a query of about 50,000 records using ActiveRecord's <code>find_each</code> method, but it seems to be ignoring my other parameters like so:</p>
  
  <pre><code>Thing.active.order("created_at DESC").limit(50000).find_each {|t| puts t.id }
  </code></pre>
  
  <p>Instead of stopping at 50,000 I'd like and sorting by <code>created_at</code>, here's the resulting query that gets executed over the <em>entire</em> dataset:</p>
  
  <pre><code>Thing Load (198.8ms)  SELECT "things".* FROM "things" WHERE "things"."active" = 't' AND ("things"."id" &gt; 373343) ORDER BY "things"."id" ASC LIMIT 1000
  </code></pre>
  
  <p>Is there a way to get similar behavior to <code>find_each</code> but with a total max limit and respecting my sort criteria?</p>