Is it possible to order multiple columns by using

2020-08-01 06:15发布

问题:

I am using Ruby on Rails 3.2.2 and I would like to know if it is possible to order multiple columns/fields by using the ORDER BY FIELD statement (for example, as made in the Model.order("orders_count, created_at, name, ...") but for ORDER BY FIELD).

If so, how can I "ORDER BY FIELDS"?

P.S.: As written in a previous answer, in order to order my records relating to one column I am using the Model.order("field(status, 'blocked', 'unpublished', 'published')") statement.