[CDBI] Re: Only two has_many/has_a relationships?

Venky Nandagopal indigo.violet at gmail.com
Sun Oct 9 23:28:52 BST 2005


Sorry for double posting, but I just found out that this problem goes away  
if I use the third argument to has_many specifying which column in the  
foreign class references us (as documented). This implies that the code  
that checks the has_a relationships of the foreign class to find which  
column references us is not working correctly. To be more explicit with  
respect to the example below

if I say

C->has_many( all_Ds => 'D', 'C_id' );
dump $c_obj->all_Ds();

it works.

(I just noticed I mistyped in my previous email -- I'm not calling all_Ds  
on the class C)

On Sun, 09 Oct 2005 14:51:41 -0700, Venky Nandagopal  
<indigo.violet at gmail.com> wrote:

> I'm using Class::DBI 3.0.9 (actually Class::DBI::mysql). I just  
> discovered
> that when I have, say classes A, B, C and D
>
> A has_many D
> B has_many D
> C has_many D
>
> D has_a A
> D has_a B
> D has_a C
>
> Then the "D has_a C" relationship is not recognized. I notice this when I
> try to pull all D belonging to class C by saying something like
>
> dump C->all_Ds();
>
> Error: C is not a column of D
>
> (the has_many relationship was defined as C->has_many( all_Ds => 'D' ); )
>
> I also see it when I try to use the add_to_all_Ds method from class C.
>
> Sorry this isn't a more concrete test -- can anyone help with this?
>
> Venky
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/




More information about the ClassDBI mailing list