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=45251fad03d811aa5d6c411506ae0f6a7953e8f7;hpb=b24d86a1fbeb89083bc2eeeeb286d590ffea702a;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/ResultClass/HashRefInflator.pm b/lib/DBIx/Class/ResultClass/HashRefInflator.pm index 45251fa..6d019ad 100644 --- a/lib/DBIx/Class/ResultClass/HashRefInflator.pm +++ b/lib/DBIx/Class/ResultClass/HashRefInflator.pm @@ -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