title: apply ordering on limit query of active record
body: <p>I need to find 10 records first and then apply ordering on that.</p>
  
  <pre><code>Model.all.limit(10).order('cast(code as integer)')
  </code></pre>
  
  <p>result of above code is - first it applies order on model and then limit query. So, I get same codes in my listing for given model. But I want to apply limit query first and then order fetched result.</p>