Reputation: 2743
Let's say I have a collection products with the following values for "name":
The following code:
@products.reorder('name ASC') # I really need to use reorder in my code
will list the results as-is:
What should I tweak in reorder()
to have the following order:
Upvotes: 1
Views: 438
Reputation: 1075
@products.reorder("(name ~ '^[0-9]'), name")
Explanation: FALSE sorts before TRUE so digit values will be last.
Upvotes: 1