In this case you should fall back to using find_by_sql method.
Kent.
On 2/9/06, Dylan Markow <dylan@dylanmarkow.com>
wrote:> I have three tables, Invoices, Projects, and Managers.
>
> Each manager has many projects. Each project has many invoices.
>
> When displaying a list of the invoices, I am using:
>
> Invoice.find(:all, :include => [:project])
>
> Since the list shows information from the project table. (For
> example, a table showing Invoice Date, Project Name). However, I''d
> also like to show the manager name. Theoretically, i''d like to be
> able do an eager loading of both :project, and :manager. Right now,
> my list generates an individual SQL query for each invoice to display
> the manager name. Trying to do :include => [:project, :manager]
> obviously doesn''t work, as the manager_id is linked into the
Projects
> table, not Invoices.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>