[Dbix-class] DBIx::Class::ResultSet::next(): No such relationship ....

Peter Rabbitson rabbit+dbic at rabbit.us
Fri Feb 27 14:24:09 GMT 2009


ivan wrote:
> 
> 
> 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__->table("pr_areas");
> ...
> 
> __PACKAGE__->belongs_to(
>   "arid",
>   "PrArea",
>   { arid => "arid" },
> );
> ...

Just as DBIC is telling you VertelkaFirmArea does not have a relationship
called pr_areas. Instead you have a relationship called 'arid'. The join
attribute takes relationship names, not table names.



More information about the DBIx-Class mailing list