Ordering by a two fields, one being created_at, In Rails
问题 This is a follow-up question to Custom, Efficient, Complex Ordering in Rails 3 I'd like to develop an efficient ordering method for a rails model I have. Suppose that I save a rating for all objects in a field named "popularity". If I wanted to sort by this rating I would do: Model.order('popularity ASC') How would I order by a skew for created at? Is there a way to, perhaps, convert the creation timestamp to an integer value, and then sort by popularity - created_at such that older objects'