I have an object with attribute impressionist_count. impressionist_count is a Fixnum.
object.impressionist_count
# => `20`, `1000`, `26`, etc.
I want to sort all my objects in descending order, but it does not work, something like:
Objects.order_by(:impressionist_count, :desc)
I don’t know what I am doing wrong. How can I fix this code?
Use
.desc():Or you can use
.order_by()if you wrap using arrays like this: