[Bast-commits] r4186 - DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat

schwern at dev.catalyst.perl.org schwern at dev.catalyst.perl.org
Wed Mar 12 21:29:59 GMT 2008


Author: schwern
Date: 2008-03-12 21:29:58 +0000 (Wed, 12 Mar 2008)
New Revision: 4186

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/LazyLoading.pm
Log:
Fix lazy loading when the object has been deleted


Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/LazyLoading.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/LazyLoading.pm	2008-03-12 14:35:53 UTC (rev 4185)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/LazyLoading.pm	2008-03-12 21:29:58 UTC (rev 4186)
@@ -103,7 +103,9 @@
     #                                   $self->ident_condition);
     # Not sure why the first one works and this doesn't :(
     my @val = $cursor->next;
-#warn "Flesh: ".join(', ', @want, '=>', @val);
+
+    return unless @val; # object must have been deleted from the database
+
     foreach my $w (@want) {
       $self->{'_column_data'}{$w} = shift @val;
     }




More information about the Bast-commits mailing list