$rel_info->{cond}, $rel, $self
);
if ($rel_info->{attrs}->{undef_on_null_fk}){
- return unless ref($cond) eq 'HASH';
- return if grep { not defined } values %$cond;
+ return undef unless ref($cond) eq 'HASH';
+ return undef if grep { not defined $_ } values %$cond;
}
my $val = $self->find_related($rel, {}, {});
-
- # this really should have been:
- # return $val unless $val
- # however someone might already be relying on return() as in:
- # my @things = map { $_->might_have_acc } ($rs->all)
- # thus keeping the quirky behavior
- return unless defined $val;
+ return $val unless $val; # $val instead of undef so that null-objects can go through
return $self->{_relationship_data}{$rel} = $val;
}