X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FImaDBI.pm;h=43537ff408c5b02743880266b15e042eeab3b0ad;hp=ee9aae0c64525b81931afde5cc5dbaae5f2b3568;hb=e570488ade8f327f47dd3318db3443a348d561d6;hpb=b83736a7d3235d2f50fe5695550eb3637432d960 diff --git a/lib/DBIx/Class/CDBICompat/ImaDBI.pm b/lib/DBIx/Class/CDBICompat/ImaDBI.pm index ee9aae0..43537ff 100644 --- a/lib/DBIx/Class/CDBICompat/ImaDBI.pm +++ b/lib/DBIx/Class/CDBICompat/ImaDBI.pm @@ -52,9 +52,12 @@ sub sth_to_objects { $sth->execute(@$execute_args); - my @ret; + my (@ret, $rsrc); while (my $row = $sth->fetchrow_hashref) { - push(@ret, $class->inflate_result($class->result_source_instance, $row)); + push(@ret, $class->inflate_result( + ( $rsrc ||= $class->result_source ), + $row + )); } return @ret;