Displaying 1 result from an estimated 1 matches for "setor_pai".
2005 May 01
0
Eager loading with self associations
...I''m new to ruby on rails and I''m trying to make a self association (as
when an employee has a manager, whom is also an employee) work with
eager loading on postgres, but the generated sql is wrong
the two ends of the association are in the same table (setores), the
foreign key is setor_pai and the generated SQL contains this:
FROM setores LEFT OUTER JOIN setores ON setores.setor_pai = setores.id
is this a problem with the driver or what?
so, how can I alias the table names in the generated sql? or is there
a way to use find_by_sql with eager loading?
I''m using ruby 1.8.2...