in reply to Re^2: dbix: Can't handle this yet error (joining using or?)
in thread dbix: Can't handle this yet error (joining using or?)
After getting some sleep I realized the most obvious answer to the problem would be to have each Trade belong to two Nations.
package Game::DB::Schema:Trades; __PACKAGE__->belongs_to( creator => 'Game::DB::Schema::Nation', { 'foreign.id' => 'self.id1', }, ); __PACKAGE__->belongs_to( acceptor => 'Game::DB::Schema::Nation', { 'foreign.id' => 'self.id2', }, );
At the top of DBIx::Class::Relationship in the Synopsis there is even an example of this showing a many-to-many relationship which you could probably even implement if you wanted to.
|
|---|