X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultClass%2FHashRefInflator.pm;h=6d019ad83cc5441811d9d2b888858e81fb5eac84;hb=5978a0e8eea03cedc3ad471b84d8eac4769f47eb;hp=1b3f2d16b7745aa8a82f095614cfe3fb4566a749;hpb=088476d4e792951b2e11229d168636dff027e84d;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultClass/HashRefInflator.pm b/lib/DBIx/Class/ResultClass/HashRefInflator.pm index 1b3f2d1..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;