Re: [CDBI] A many to many relationship question (getting error)

Giannis Economou <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
Peter Speltz wrote:
>> ERROR:
>> usersinfo is not a column of RemindMe::Data::UsersGroups at
>> /usr/local/share/perl/5.8.7/Class/DBI/Relationship/HasMany.pm line 112
>>
>
> Has many uses the has_a column  to determine the FK  and if there is
> no has_a  then it assumes the class moniker which is "userinfo" .  Put
> user_groups definition before the others since it defines the has_a 's. 

I'm using different files for each of my classes and all of them have a
line
use base 'BaseDB';
before any other "use" statements (BaseDB is_a Class::DBI).
I guess it should be working this way, but anyway...

> Alternatively, and what i mostly do to prevent this error  ,
> specify the FK name as a 3rd arg to has_many  ie :
>
> __PACKAGE__->has_many( users => [ 'UsersGroups' => 'uid' ] , 'gid');
>
> See docs for more details.

Did that, everything is working fine now. Thank you.



G.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.