}
$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 || {}} }
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(