Subject: Re: Sort array by two attributes? (like sql "order by A, B")
From: Max Williams <toastkid.williams gmail.com>
Date: Tue, 12 Aug 2008 17:19:37 +0900
References: 310865310866310899
In-reply-to: 310899
Pit Capitain wrote:
> objects.sort do |a, b|
> (a.lastname <=> b.lastname).nonzero? ||
> (a.firstname <=> b.firstname)
> end
Wow, this is all great stuff. thanks folks.
--
Posted via http://www.ruby-forum.com/.