From: Erik Veenstra Date: 2008-08-12T00:48:19+09:00 Subject: Re: Sort array by two attributes? (like sql "order by A, B") > That's a neat trick, thanks!  I actually like the first one better > though as you can swap a & b around in each test to get (eg) sorted by > name ascending and then a date field descending. Just use -x.b: a.sort_by{|x| [x.name, -x.date]} Sort_by is much faster than sort with a block. gegroet, Erik V.