From: zby Date: Thu, 14 May 2009 14:55:06 +0000 (+0000) Subject: accepting undef instead of [] for m2m X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=dc1fe833dfe0abb9031811c18d1cff5f3b968489;p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate accepting undef instead of [] for m2m --- diff --git a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm index f288135..f86fea6 100644 --- a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm +++ b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm @@ -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 ) { diff --git a/t/var/dvdzbr.db b/t/var/dvdzbr.db index f96d3d5..5277e1b 100644 Binary files a/t/var/dvdzbr.db and b/t/var/dvdzbr.db differ