]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/blobdiff - lib/DBIx/Class/ResultSet/RecursiveUpdate.pm
handle DBIx::Class change for find which throws an exception since version > 0.08123
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / lib / DBIx / Class / ResultSet / RecursiveUpdate.pm
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.017746 seconds and 4 git commands to generate.