projects
/
dbsrgits/DBIx-Class.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
initial merge of Schwern's CDBICompat work, with many thanks
[dbsrgits/DBIx-Class.git]
/
lib
/
DBIx
/
Class
/
Relationship
/
Base.pm
diff --git
a/lib/DBIx/Class/Relationship/Base.pm
b/lib/DBIx/Class/Relationship/Base.pm
index
1fbcf52
..
09dfbbf
100644
(file)
--- a/
lib/DBIx/Class/Relationship/Base.pm
+++ b/
lib/DBIx/Class/Relationship/Base.pm
@@
-288,7
+288,8
@@
L<DBIx::Class::Row/insert> on it.
sub find_or_new_related {
my $self = shift;
- return $self->find_related(@_) || $self->new_related(@_);
+ my $obj = $self->find_related(@_);
+ return defined $obj ? $obj : $self->new_related(@_);
}
=head2 find_or_create_related