From: Alexander Hartmaier Date: Sat, 23 Oct 2010 14:13:11 +0000 (+0200) Subject: fixed bug where an object that has already been found by its pk is overwritten by... X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate;a=commitdiff_plain;h=6a543315be718c91b051b5a0fbd4100892dda59f;ds=sidebyside fixed bug where an object that has already been found by its pk is overwritten by an new one and later found again by update_or_create --- diff --git a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm index e9b56e4..67a7ffd 100644 --- a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm +++ b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm @@ -81,7 +81,9 @@ sub recursive_update { # warn 'finding by +resolved: ' . Dumper( $updates ); use Data::Dumper; $object = $self->find( $updates, { key => 'primary' } ); } - $object ||= $self->new( {} ); + + $object = $self->new( {} ) + unless defined $object; # warn Dumper( $updates ); use Data::Dumper; # direct column accessors