]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/commitdiff
accepting undef instead of [] for m2m
authorzby <zby@bd8105ee-0ff8-0310-8827-fb3f25b6796d>
Thu, 14 May 2009 14:55:06 +0000 (14:55 +0000)
committerzby <zby@bd8105ee-0ff8-0310-8827-fb3f25b6796d>
Thu, 14 May 2009 14:55:06 +0000 (14:55 +0000)
lib/DBIx/Class/ResultSet/RecursiveUpdate.pm
t/var/dvdzbr.db

index f288135edd9f2bf01838c142aa3f85d02990ed5f..f86fea6a5fa4d4fca186b7a7eea8d05f3e2c1fa0 100644 (file)
@@ -117,11 +117,14 @@ sub recursive_update {
             my @rows;
             my $result_source = $object->$name->result_source;
             my @updates;
-            if( ref $updates->{$name} ){
-                @updates = @{ $updates->{$name} };
+            if( ! defined $value ){
+                next;
+            }
+            elsif( ref $value ){
+                @updates = @{ $value };
             }
             else{
-                @updates = ( $updates->{$name} );
+                @updates = ( $value );
             }
             for my $elem ( @updates ) {
                 if ( ref $elem ) {
index f96d3d59c461516e086df8304cd25e8db8fdeea5..5277e1b27b154a985c6bf3b99f6392ceae8abc7d 100644 (file)
Binary files a/t/var/dvdzbr.db and b/t/var/dvdzbr.db differ
This page took 0.020743 seconds and 4 git commands to generate.