Ruby on Rails: how do I sort with two columns using ActiveRecord? June 7, 2023 by Tarik In Rails 4 you can do something similar to: Model.order(foo: :asc, bar: :desc) foo and bar are columns in the db.