X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSet%2FRecursiveUpdate.pm;h=04142321b223ac7e0e2530b45d0e2cb0c5d36088;hp=eeec84cdd240e2007b07101c2d3cd784f184ce62;hb=db9660bec391cd788bf6b1bbee3ff4333c99633b;hpb=122716e149778430ea35310a4d93144af4fd1559 diff --git a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm index eeec84c..0414232 100644 --- a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm +++ b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm @@ -107,8 +107,7 @@ sub recursive_update { # don't allow insert to recurse to related objects - we do the recursion ourselves # $object->{_rel_in_storage} = 1; - $object->update_or_insert; - + $object->update_or_insert if $object->is_changed; # updating many_to_many for my $name ( keys %$updates ) { @@ -215,7 +214,7 @@ sub _update_relation { } elsif( ! ref $sub_updates ){ $sub_object = $related_result->find( $sub_updates ) - unless (!$sub_updates && ($info->{attrs}{join_type} eq 'LEFT')); + unless (!$sub_updates && ($info->{attrs}{join_type} eq 'LEFT')); } $object->set_from_related( $name, $sub_object ) unless (!$sub_object && !$sub_updates && ($info->{attrs}{join_type} eq 'LEFT'));