From: Matt S Trout Date: Wed, 11 Jan 2006 01:54:09 +0000 (+0000) Subject: Probably fixed an incipient bug in prefetch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2fb096198c565e6f3cbc013ea7458fb42d93ec8d;p=dbsrgits%2FDBIx-Class-Historic.git Probably fixed an incipient bug in prefetch --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index b64711e..b33a3e9 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -257,13 +257,13 @@ sub inflate_result { my $fetched = $pre_class->inflate_result(@{$prefetch->{$pre}}); $class->throw("No accessor for prefetched $pre") unless defined $rel_obj->{attrs}{accessor}; - if ($rel_obj->{attrs}{accessor} eq 'single') { - PRIMARY: foreach my $pri ($rel_obj->{class}->primary_columns) { - unless (defined $fetched->get_column($pri)) { - undef $fetched; - last PRIMARY; - } + PRIMARY: foreach my $pri ($rel_obj->{class}->primary_columns) { + unless (defined $fetched->get_column($pri)) { + undef $fetched; + last PRIMARY; } + } + if ($rel_obj->{attrs}{accessor} eq 'single') { $new->{_relationship_data}{$pre} = $fetched; } elsif ($rel_obj->{attrs}{accessor} eq 'filter') { $new->{_inflated_column}{$pre} = $fetched;