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',
}
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