Skip to content

Commit

Permalink
Merge pull request #18716 from RodrigoDornelles/patch-1
Browse files Browse the repository at this point in the history
use getTargetClass in function checkTargetAttributeExistence
  • Loading branch information
Bizley committed Jun 17, 2021
2 parents e2b90b5 + dac40fa commit 7e3aa22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/validators/ExistValidator.php
Expand Up @@ -169,7 +169,7 @@ private function checkTargetAttributeExistence($model, $attribute)
$conditions[] = $params;
}

$targetClass = $this->targetClass === null ? get_class($model) : $this->targetClass;
$targetClass = $this->getTargetClass($model);
$query = $this->createQuery($targetClass, $conditions);

if (!$this->valueExists($targetClass, $query, $model->$attribute)) {
Expand Down

0 comments on commit 7e3aa22

Please sign in to comment.