I have found various blogs and comments on the issue of merging order
scopes but have not been able to determine whether the current
situation is regarded as satisfactory.
Using Rails 3.0.4, the particular case I am considering is
Item.order( ‘x DESC’).order(‘x ASC’)
This appears to merge the sorts in the wrong order so that the result
is x DESC. The sql generated is
SELECT ‘items’.* FROM ‘items’ ORDER BY id DESC, id ASC
Which results in descending order (SQL is rather non-intuitive here).
One result is that it is not possible (as far as I can see) to
override a default or named scope that applies a sort order.
Perhaps I am missing something obvious.