Add pod for params of inflate/deflate coderefs
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / Relationship / Base.pm
index ccbc433..05f4c52 100644 (file)
@@ -53,7 +53,7 @@ relationship from C<Book> to C<Edition>, where the C<Edition> table refers to a
 publisher and a type (e.g. "paperback"):
 
   {
-    'foreign.publisher_id' => 'self.publisher_id'
+    'foreign.publisher_id' => 'self.publisher_id',
     'foreign.type_id'      => 'self.type_id',
   }
 
@@ -264,7 +264,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 set_from_related