X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultClass%2FHashRefInflator.pm;h=fc0ee37c07718c7cd71132d3c7a121866f46576b;hb=419ff18467b5fb8142cc33f2aac9e06237937b72;hp=4aa362ab0e5b542927f9d978503543fe5b15aa2b;hpb=d0dfedc2ecb409f2f8befc523602e268ff844127;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultClass/HashRefInflator.pm b/lib/DBIx/Class/ResultClass/HashRefInflator.pm index 4aa362a..fc0ee37 100644 --- a/lib/DBIx/Class/ResultClass/HashRefInflator.pm +++ b/lib/DBIx/Class/ResultClass/HashRefInflator.pm @@ -87,4 +87,21 @@ sub mk_hash { }; } +=head1 CAVEAT + +This will not work for relationships that have been prefetched. Consider the +following: + + my $artist = $artitsts_rs->search({}, {prefetch => 'cds' })->first; + + my $cds = $artist->cds; + $cds->result_class('DBIx::Class::ResultClass::HashRefInflator'); + my $first = $cds->first; + +C<$first> will B be a hashref, it will be a normal CD row since +HashRefInflator only affects resultsets at inflation time, and prefetch causes +relations to be inflated when the master C<$artist> row is inflated. + +=cut + 1;