in reply to Re: Class::DBI and a self-referencing many-to-many
in thread Class::DBI and a self-referencing many-to-many

That's pretty much identical to what I did. I even get an identical error. :-)

My test code was:

my $page1 = My::Page->create({ location => 'abc' }); my $page2 = $page1->add_to_inbound({ location => 'def' });

The error I get:

location is not a column of My::Link at /usr/lib/perl5/site_perl/5.8.6/Class/DBI/Relationship/HasMany.pm line 92

This is with Class::DBI 3.04.

Update:

Maybe this is just a problem with the auto-created add_to_* method. If I:

my $page1 = My::Page->create({ location => 'abc' }); my $page2 = My::Page->create({ location => 'def' }); My::Link->create({src => $page1, dst => $page2}); croak Dumper([$page1->inbound()], [$page1->outbound()], [$page2->inbound()], [$page2->outbound()], );

I almost get what I expect. Should $page1->inbound() return a My::Link or an array of My::Pages?