$pre_source, @{$pre_rec}));
}
$new->related_resultset($pre)->set_cache(\@pre_objects);
- } else {
+ } elsif (defined $pre_val->[0]) {
my $fetched;
unless ($pre_source->primary_columns == grep { exists $pre_val->[0]{$_}
and !defined $pre_val->[0]{$_} } $pre_source->primary_columns)
return $new;
}
-=head2 insert_or_update
+=head2 update_or_insert
- $obj->insert_or_update
+ $obj->update_or_insert
Updates the object if it's already in the db, else inserts it.
=cut
-sub insert_or_update {
+*insert_or_update = \&update_or_insert;
+sub update_or_insert {
my $self = shift;
return ($self->in_storage ? $self->update : $self->insert);
}