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
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
2 matches
Mail list logo