package DBIx::Class::ResultClass::HashRefInflator;
+use strict;
+use warnings;
+
=head1 NAME
DBIx::Class::ResultClass::HashRefInflator
# related sources.
# to avoid emtpy has_many rels contain one empty hashref
- return if (not keys %$me);
+ return undef if (not keys %$me);
my $def;
last;
}
}
- return unless $def;
+ return undef unless $def;
return { %$me,
map {
( $_ =>
- ref($rest->{$_}[0]) eq 'ARRAY' ? [ map { mk_hash(@$_) } @{$rest->{$_}} ]
- : mk_hash( @{$rest->{$_}} )
+ ref($rest->{$_}[0]) eq 'ARRAY'
+ ? [ grep defined, map mk_hash(@$_), @{$rest->{$_}} ]
+ : mk_hash( @{$rest->{$_}} )
)
} keys %$rest
};