Remove hard coded key name ref
This commit is contained in:
parent
c9ae293935
commit
bdb3d5ff45
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue