Posted by Vince Wadhwani on Apr 17, 2008

I honestly don't know how I went this long without every having to use this, but since googling for it can be a bit of a hassle, I thought I'd share this tip with you. Let's say you're in a situation where you first have to sort by date and then alphabetically. How do you put two :order's in the condition? Simple:

@foo = Foo.find(:all, :order => 'created_at desc, name desc')

The magic comma in the quotes passes it along correctly. Thanks to AndrewO for saving me the hair pulling.