title: Complex Order By Queries using Rails 3.0 + Postgres
body: <p>Does rails have any way to have complex sorting at the database query level?</p>
  
  <p>Ie/</p>
  
  <p><code>Posts.order(up / down).all</code> ?</p>
  
  <p>What would be the best way to implement this on a database level (in postgres) without having to sort through a result in ruby using sort (which will slow down pagination etc).</p>