]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/blobdiff - lib/DBIx/Class/ResultSet/RecursiveUpdate.pm
merge conflict resolved
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / lib / DBIx / Class / ResultSet / RecursiveUpdate.pm
index eeec84cdd240e2007b07101c2d3cd784f184ce62..04142321b223ac7e0e2530b45d0e2cb0c5d36088 100644 (file)
@@ -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;
 
 # 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 ) {
 
     # 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 ) 
         }
         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'));
         }
         $object->set_from_related( $name, $sub_object )
           unless (!$sub_object && !$sub_updates && ($info->{attrs}{join_type} eq 'LEFT'));
This page took 0.01913 seconds and 4 git commands to generate.