- fix recent belongs_to changes
David Kamholz [Thu, 26 Jan 2006 15:32:25 +0000 (15:32 +0000)]
- revert accessor in basicrels

lib/DBIx/Class/Relationship/BelongsTo.pm
t/lib/DBICTest/Schema/BasicRels.pm

index 326a99a..093d0be 100644 (file)
@@ -45,7 +45,7 @@ sub belongs_to {
       }
       $cond_rel->{"foreign.$_"} = "self.".$cond->{$_};
     }
-    my $acc_type = (scalar keys %$cond_rel == 1) ? 'filter' : 'single';
+    my $acc_type = (keys %$cond_rel == 1 and $class->has_column($rel)) ? 'filter' : 'single';
     $class->add_relationship($rel, $f_class,
       $cond_rel,
       { accessor => $acc_type, %{$attrs || {}} }
index 9894bb9..a3e7279 100644 (file)
@@ -71,14 +71,12 @@ DBICTest::Schema::SelfRef->add_relationship(
 
 DBICTest::Schema::Tag->add_relationship(
     cd => 'DBICTest::Schema::CD',
-    { 'foreign.cdid' => 'self.cd' },
-    { accessor => 'single' }
+    { 'foreign.cdid' => 'self.cd' }
 );
 
 DBICTest::Schema::Track->add_relationship(
     cd => 'DBICTest::Schema::CD',
-    { 'foreign.cdid' => 'self.cd' },
-    { accessor => 'single' }
+    { 'foreign.cdid' => 'self.cd' }
 );
 
 DBICTest::Schema::TwoKeys->add_relationship(