]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/commitdiff
handle DBIx::Class change for find which throws an exception since version > 0.08123
authorAlexander Hartmaier <abraxxa@cpan.org>
Mon, 25 Oct 2010 15:16:54 +0000 (17:16 +0200)
committerAlexander Hartmaier <abraxxa@cpan.org>
Mon, 25 Oct 2010 15:16:54 +0000 (17:16 +0200)
dist.ini
lib/DBIx/Class/ResultSet/RecursiveUpdate.pm

index 03ff85e05beca59fb92c1fbaed8fa443a26b0606..bb67d6076717799fd402840af5ffaac75513b263 100644 (file)
--- a/dist.ini
+++ b/dist.ini
@@ -41,6 +41,7 @@ DBD::SQLite = 1.21
 Readonly = 1.03
 List::MoreUtils = 0.22
 Carp::Clan = 6.04
+Try::Tiny = 0.07
 
 [Prereqs / TestRequires]
 Test::More = 0.88
index 20158603eb191e82e672e138c2e2c20bd0aec591..ebb29f26c8d6ba3f6cfb6c3bf76e14665d4d1114 100644 (file)
@@ -37,6 +37,7 @@ package DBIx::Class::ResultSet::RecursiveUpdate::Functions;
 use Carp::Clan qw/^DBIx::Class|^HTML::FormHandler|^Try::Tiny/;
 use Scalar::Util qw( blessed );
 use List::MoreUtils qw/ any /;
+use Try::Tiny;
 
 sub recursive_update {
     my %params = @_;
@@ -86,14 +87,18 @@ sub recursive_update {
     if ( !defined $object && scalar @missing == 0 ) {
 
         # warn 'finding by: ' . Dumper( $updates ); use Data::Dumper;
-        $object = $self->find( $updates, { key => 'primary' } );
+        try {
+            $object = $self->find( $updates, { key => 'primary' } );
+        };
     }
     $updates = { %$updates, %$resolved };
     @missing = grep { !exists $resolved->{$_} } @missing;
     if ( !defined $object && scalar @missing == 0 ) {
 
-        # warn 'finding by +resolved: ' . Dumper( $updates ); use Data::Dumper;
-        $object = $self->find( $updates, { key => 'primary' } );
+       # warn 'finding by +resolved: ' . Dumper( $updates ); use Data::Dumper;
+        try {
+            $object = $self->find( $updates, { key => 'primary' } );
+        };
     }
 
     $object = $self->new( {} )
This page took 0.0238 seconds and 4 git commands to generate.