[Rails] Re: Trying to sort results of one-to-many relationship find

2009-01-08 Thread Harold
This is a plain association, no join table involved. Try this in script/console and see if it solves your problem. The DB can easily take care of the sorting: orders = Order.find(:all, :conditions = '...', :include = :payee, :order = 'payees.last_name') Then, orders.each { |o| puts

[Rails] Re: Trying to sort results of one-to-many relationship find

2009-01-08 Thread Corey Murphy
Harold wrote: orders = Order.find(:all, :conditions = '...', :include = :payee, :order = 'payees.last_name') Awesome. The :include option wasn't something I was aware you could use in a find for the model. I knew this could be handled using a nice rails-like convention without having to