X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultClass%2FHashRefInflator.pm;h=6d019ad83cc5441811d9d2b888858e81fb5eac84;hb=cf48da0c9ecff776e12d1f194c3be24b8079f1f4;hp=5fffad482e31e44ca7d8175d2d57dfbedf2a2e15;hpb=e1540ee0230804b9bc519357b703a9d1f09bce7b;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/ResultClass/HashRefInflator.pm b/lib/DBIx/Class/ResultClass/HashRefInflator.pm index 5fffad4..6d019ad 100644 --- a/lib/DBIx/Class/ResultClass/HashRefInflator.pm +++ b/lib/DBIx/Class/ResultClass/HashRefInflator.pm @@ -5,7 +5,7 @@ use warnings; =head1 NAME -DBIx::Class::ResultClass::HashRefInflator +DBIx::Class::ResultClass::HashRefInflator - Get raw hashrefs from a resultset =head1 SYNOPSIS @@ -73,8 +73,15 @@ $mk_hash = sub { # if there is at least one defined column consider the resultset real # (and not an emtpy has_many rel containing one empty hashref) + # an empty arrayref is an empty multi-sub-prefetch - don't consider + # those either for (values %$hash) { - return $hash if defined $_; + if (ref $_ eq 'ARRAY') { + return $hash if @$_; + } + elsif (defined $_) { + return $hash; + } } return undef; @@ -116,6 +123,12 @@ 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. +=item * + +Column value inflation, e.g., using modules like +L, is not performed. +The returned hash contains the raw database values. + =back =cut