Is there a way to include associations of the associations you're
an example, you could have "orders" belonging to an "account", which
belongs to a "person". When I want to list orders sorted by the name
account owners, I need to be able to do something like:
orders.find(:all, :include => "account.person", :order =>
but that doesn't work... I tried to do it like:
orders.find(:all, :joins => "JOIN accounts AS account
ON account.id = order.account_id
JOIN people AS person
ON person.id = account.person_id",
:from => "order AS order")
But that had the side effect of orders.id becoming the id of person.
So, is there any good way of doing this?
Thanks in advance.