[Dbix-class] Issue when prefetching two level deep has_manyrelationships

Nilson Santos Figueiredo Junior acid06 at gmail.com
Fri Sep 22 17:06:44 CEST 2006


On 9/22/06, Hartmaier Alexander <Alexander.Hartmaier at t-systems.at> wrote:
> If B does not always has_many C's you have to specify it as an outer join with { join_type => 'LEFT' } in join relationship definition.
> You can see an example in the docs above the has_many section:

The generated SQL already contains a LEFT OUTER JOIN, since it's a
has_many relationship. As I've said in one of the messages, *the
generated query is fine*.

The problem lies in DBIC where it tries to construct the objects using
the results. Unfortunately, I can't think of a way of fixing it myself
without rewriting the whole one hundred line recursive monster (which
probably would result in a more than one hundred lines, uglier,
recursive monster).

-Nilson Santos F. Jr.



More information about the Dbix-class mailing list