When building a relationship Belongs to Many with Pivot Data the lack of a table name causes an sql ambiguous ID error.

This commit is contained in:
Carlos Arroyo 2014-12-17 19:14:21 +11:00
parent 8cdb24c40a
commit 90d5bde28c
1 changed files with 1 additions and 1 deletions

View File

@ -604,7 +604,7 @@ class RelationController extends ControllerBehavior
/*
* Check for existing relation
*/
$foreignKeyName = $this->relationModel->getKeyName();
$foreignKeyName = $this->relationModel->getQualifiedKeyName();
$existing = $this->relationObject->where($foreignKeyName, $foreignId)->count();
if (!$existing) {