You are using the wrong backets for your last arguments to has_many and belongs_to. Using [ ] creates an array reference and the docs ask for a hash reference ({ }).
You can also save typing by using the accessor methods instead of using empty searche_relateds like so:
my $resource_rs = $nation_rs->trades->nation->resources;Assuming there is a "resources" relation inside your nation class that you are omitting.
After posting the above and rereading your post I found what may be a problem with the schema. I'm not sure if a belongs_to relationship can be used to give multiple results. At least when I have used it, and in all examples I've found, belongs_to is used to return the owner instance (row) of the owner class (table).
Told another way, the nation has many trades. Sure that's nice. But can the trade belong to many nations and have more than one owner? I would't think so, at least not in the context of DB relationships.
I would imagine a trade has many nations making this a many to many relationship but I can't think of how to preserve who traded what in what direction. Maybe someone with more DB experience can help where I've fallen short. Assuming, of course, that this is even an error!
In reply to Re: dbix: Can't handle this yet error (joining using or?)
by juster
in thread dbix: Can't handle this yet error (joining using or?)
by uG
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |