If you want to sort a Ruby array with a primary, secondary, etc. criterium, use a sort_by
that contains a block:
users.sort_by { |user| [user.age, user.name] }
This trick also works with our natural sort method.
Posted by Henning Koch to makandra dev (2013-12-20 13:36)