Does rails have any way to have complex sorting at the database query level?
Ie/
Posts.order(up / down).all ?
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).