Sorting has_many - via parent association

Video.find(:all, :include => :bands, :order => "bands.name, videos.name")

should work, I think.

Note that the include option also means that all of the bands will be instantiated on this query, which may or may not be a good thing depending on what you're going to do next.

I wrote a patch which is now in edge rails which extends the :joins option to take the same kind of values as includes. This lets you do:

Video.find(:all, :joins => :bands, :order => "bands.name, videos.name")

Which does the same thing, but only instantiates the videos.

Be warned though, this patch may or may not make it into Rails 2.0 since it's very new.