From 6a543315be718c91b051b5a0fbd4100892dda59f Mon Sep 17 00:00:00 2001 From: Alexander Hartmaier Date: Sat, 23 Oct 2010 16:13:11 +0200 Subject: [PATCH] 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 --- lib/DBIx/Class/ResultSet/RecursiveUpdate.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.45.2