Re: FW: many to many help
[prev]
[thread]
[next]
[Date index for 2004/06/09]
On Wed, Jun 09, 2004 at 01:34:59PM -0600, Bruner, Todd wrote:
> OK, I now know that the XYZ::Links needs to be before XYZ::Things if they
> are in the same file. However, I still run into a problem with cascading
> delete. Namely, as coded below, the cascading delete will only delete the
> rows in the Links table with srcThingId = to target, and ignores rows in the
> Links table with dstThingId = to target.
I'm still not sure I understand the set-up, but I think you want two
different has_many declarations, one to match each of the has_a() ones:
You currently have:
> XYZ::Links->has_a(srcThingId => 'XYZ::Things');
> XYZ::Links->has_a(dstThingId => 'XYZ::Things');
and
> XYZ::Things->has_many(links => 'XYZ::Links');
But you probably want
XYZ::Things->has_many(src_links => 'XYZ::Links', 'srcThingId');
XYZ::Things->has_many(dst_links => 'XYZ::Links', 'dstThingId');
Tony
|
|
Re: FW: many to many help
Tony Bowden 19:44 on 09 Jun 2004
|