[Dbix-class] Issue when prefetching two level deep has_many relationships

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


On 9/22/06, Jess Robinson <castaway at desert-island.demon.co.uk> wrote:
> C<prefetch> can be used with the following relationship types:
> C<belongs_to>, C<has_one> (or if you're using C<add_relationship>, any
> relationship declared with an accessor type of 'single' or 'filter').
>
> I see no mention of has_many. iirc, thats not currently expected to work.

I have no idea where in the docs you found that, but if it's really
there, it is a documentation bug. Prefetching has_many relationships
has been working at least since 0.06000 (I think), probably earlier.
Also, in DBIx::Class::Relationship docs there's even an example of it
being used.

Finally, just in case there were some known issues with more than one
level has_many rels beeing prefetched, I actually asked mst yesterday
on IRC and he said it should be working alright.

-Nilson Santos F. Jr.



More information about the Dbix-class mailing list