I am trying to arrange my default_scope so that the hieroglyphs with boolean important = true displayed first, and the whole order from created_at desc.
So, I have the following code:
default_scope order_by(:important => :desc, :created_at => :desc)
But it seems that the order of the important fields is ignored.
How can I make it work?
Thank you in advance
EDIT:
I just shift the order of the order parameters and it works:
default_scope order_by(:created_at => :desc, :important => :desc)
Just so simple.
source share