[Dbix-class] DBIx::Class::ResultSet::next(): No such relationship
....
ivan
ivan at price.ru
Fri Feb 27 14:20:28 GMT 2009
error:
DBIx::Class::ResultSet::next(): No such relationship pr_areas ....
Code:
-------------------------------------------------------------------------------------
my $area_model = $c -> model("VertelkaFirmArea");
my $areas = $area_model -> search (
{ 'firm_id' => 1 },
{ join => "pr_areas" },
);
-------------------------------------------------------------------------------------
package PrArea:
....
__PACKAGE__->table("pr_areas");
....
"area",
{
data_type => "character varying",
default_value => undef,
is_nullable => 1,
size => 256,
},
....
__PACKAGE__->set_primary_key("arid");
__PACKAGE__->has_many(
"vertelka_firm_areas",
"VertelkaFirmArea",
{ "foreign.arid" => "self.arid" },
);
-------------------------------------------------------------------------------------
package VertelkaFirmArea;
__PACKAGE__->table("vertelka_firm_area");
.....
"arid",
{
data_type => "integer",
default_value => undef,
is_foreign_key => 1,
is_nullable => 0,
size => 4,
},
);
....
__PACKAGE__->belongs_to(
"arid",
"PrArea",
{ arid => "arid" },
);
...
More information about the DBIx-Class
mailing list