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

Jess Robinson castaway at desert-island.demon.co.uk
Fri Sep 22 17:29:19 CEST 2006



On Fri, 22 Sep 2006, Nilson Santos Figueiredo Junior wrote:

> 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.

Under "prefetch" in the ResultSet docs, where I'd expect it.. in trunk.. 
so someone, whomever changed that, should update the docs too..

Jess




More information about the Dbix-class mailing list