fix PK::Auto bug where it wouldn't recognize a defined but false PK
David Kamholz [Fri, 18 Nov 2005 17:26:52 +0000 (17:26 +0000)]
lib/DBIx/Class/PK/Auto.pm

index c2027cc..ac7f3dd 100644 (file)
@@ -35,7 +35,7 @@ sub insert {
 
   # if all primaries are already populated, skip auto-inc
   my $populated = 0;
-  map { $populated++ if $self->$_ } $self->primary_columns;
+  map { $populated++ if defined $self->$_ } $self->primary_columns;
   return $ret if ( $populated == scalar $self->primary_columns );
 
   my ($pri, $too_many) =