]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/blobdiff - lib/DBIx/Class/ResultSet/RecursiveUpdate.pm
avoid uninitialized string warnings
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / lib / DBIx / Class / ResultSet / RecursiveUpdate.pm
index eeec84cdd240e2007b07101c2d3cd784f184ce62..6ab316eb81a311fe947c548a1a4a6bd164c66815 100644 (file)
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 package DBIx::Class::ResultSet::RecursiveUpdate;
 
-our $VERSION = '0.012';
+our $VERSION = '0.013';
 
 use base qw(DBIx::Class::ResultSet);
 
@@ -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,10 +214,10 @@ 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 && (exists $info->{attrs}{join_type} && $info->{attrs}{join_type} eq 'LEFT'));
         }
         $object->set_from_related( $name, $sub_object )
-          unless (!$sub_object && !$sub_updates && ($info->{attrs}{join_type} eq 'LEFT'));
+          unless (!$sub_object && !$sub_updates && (exists $info->{attrs}{join_type} && $info->{attrs}{join_type} eq 'LEFT'));
     }
 }
 
@@ -317,12 +316,6 @@ __END__
 
 DBIx::Class::ResultSet::RecursiveUpdate - like update_or_create - but recursive
 
-
-=head1 VERSION
-
-This document describes DBIx::Class::ResultSet::RecursiveUpdate version 0.006
-
-
 =head1 SYNOPSIS
 
 The functional interface:
This page took 0.017228 seconds and 4 git commands to generate.