fixup! Add flag for correctly introspecting fk rels
Arthur Axel 'fREW' Schmidt [Tue, 10 Jul 2012 18:46:46 +0000 (13:46 -0500)]
pretty sure riba wanted me to remove the exists check, can't find log of
that though

lib/DBIx/Class/Relationship/BelongsTo.pm
lib/DBIx/Class/Relationship/HasMany.pm
lib/DBIx/Class/Relationship/HasOne.pm

index aeb434b..d56a89f 100644 (file)
@@ -19,7 +19,7 @@ sub belongs_to {
 
   # assume a foreign key contraint unless defined otherwise
   $attrs->{is_foreign_key_constraint} = 1
-    if not exists $attrs->{is_foreign_key_constraint};
+    if not $attrs->{is_foreign_key_constraint};
 
   $attrs->{is_foreign_rel} = 1
     if not exists $attrs->{is_foreign_rel};
index 06a3bc3..47822ea 100644 (file)
@@ -52,7 +52,7 @@ sub has_many {
   my $default_cascade = ref $cond eq 'CODE' ? 0 : 1;
 
   $attrs->{is_foreign_rel} = 0
-    if not exists $attrs->{is_foreign_rel};
+    if not $attrs->{is_foreign_rel};
 
   $class->add_relationship($rel, $f_class, $cond, {
     accessor => 'multi',
index b0d21aa..212b54b 100644 (file)
@@ -54,7 +54,7 @@ sub _has_one {
   my $default_cascade = ref $cond eq 'CODE' ? 0 : 1;
 
   $attrs->{is_foreign_rel} = 0
-    if not exists $attrs->{is_foreign_rel};
+    if not $attrs->{is_foreign_rel};
 
   $class->add_relationship($rel, $f_class,
    $cond,