From dc1fe833dfe0abb9031811c18d1cff5f3b968489 Mon Sep 17 00:00:00 2001 From: zby Date: Thu, 14 May 2009 14:55:06 +0000 Subject: [PATCH] accepting undef instead of [] for m2m --- lib/DBIx/Class/ResultSet/RecursiveUpdate.pm | 9 ++++++--- t/var/dvdzbr.db | Bin 37888 -> 37888 bytes 2 files changed, 6 insertions(+), 3 deletions(-) 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 f96d3d59c461516e086df8304cd25e8db8fdeea5..5277e1b27b154a985c6bf3b99f6392ceae8abc7d 100644 GIT binary patch delta 423 zcmZoz!PKyVX@a!i4+a##erco5L1y7}prBMwB9P?li3F0&J^q_m4zn`)PTrSvmCB}9Aqt!C zr`z!`qH8i{X=Lt6nygdW#+W?0bHX~tl*x9c?MywXlMhZbW=sRRQED>(q;SUc%@fO~ lNHAsq-5Sr*sNI84F>5-|S0I%@Uu7bEl?C=y_GCZ38~{&dkr)5~ delta 424 zcmZoz!PKyVX@az13IhsYZ`-JIkXcw0C@9sV3?w;wq=6)JkKiVj!>o+_llLWEWfYja zk4bOx2`)!Q!OdLU%A$-yll2q|8HFb=Q1D?CnYb~M*|$e@vZtayquAt`iq)**Y~uEk zlk3wYgi^{(qWm1)xd#jEa+2rxh_OO_obvz^FVqAw*&G z{d7AX3{A!?jm$kNlXXhl7*!{CPFTmNHrdX!ovBBC^1+G5j2b{kN=@dU6wau*d1Cn# l2}UiTW8+yGwR`X>X4M3G3#1b0Ep3Fibim%yo$RNV0{~V6gJu8# -- 2.45.2