From: Alexander Hartmaier Date: Sat, 23 Oct 2010 14:11:21 +0000 (+0200) Subject: don't autovivify an id key in the updates hash X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate;a=commitdiff_plain;h=a25c44676bb3eeabf0e4172bf8f2db6da039fc0b don't autovivify an id key in the updates hash --- diff --git a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm index c42f1b7..e9b56e4 100644 --- a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm +++ b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm @@ -56,8 +56,11 @@ sub recursive_update { if ( blessed($updates) && $updates->isa('DBIx::Class::Row') ) { return $updates; } - if ( $updates->{id} ) { + if ( exists $updates->{id} ) { + # warn "finding object by id " . $updates->{id} . "\n"; $object = $self->find( $updates->{id}, { key => 'primary' } ); + # warn "object not found by id\n" + # unless defined $object; } my %fixed_fields = map { $_ => 1 } @$fixed_fields