accepting undef instead of [] for m2m
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / lib / DBIx / Class / ResultSet / RecursiveUpdate.pm
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 ) {
This page took 0.01742 seconds and 4 git commands to generate.