projects
/
dbsrgits/DBIx-Class.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Merge 'trunk' into 'DBIx-Class-current'
[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
bfe63b3
..
0401c0a
100644
(file)
--- a/
lib/DBIx/Class/Relationship/Base.pm
+++ b/
lib/DBIx/Class/Relationship/Base.pm
@@
-293,7
+293,8
@@
L<DBIx::Class::ResultSet/find_or_create> for details.
sub find_or_create_related {
my $self = shift;
- return $self->find_related(@_) || $self->create_related(@_);
+ my $obj = $self->find_related(@_);
+ return (defined($obj) ? $obj : $self->create_related(@_));
}
=head2 update_or_create_related