Remove hard coded key name ref

This commit is contained in:
Sam Georges 2014-09-25 18:35:10 +10:00
parent c9ae293935
commit bdb3d5ff45
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ class Relation extends FormWidgetBase
// It is safe to assume that if the model and related model are of
// the exact same class, then it cannot be related to itself
if ($model->exists && (get_class($model) == get_class($relatedObj))) {
$query->where($relatedObj->getKeyName(), '<>', $model->id);
$query->where($relatedObj->getKeyName(), '<>', $model->getKey());
}
// Even though "no constraints" is applied, belongsToMany constrains the query