ExistValidator bugfix

This commit is contained in:
Alexander Kochetov
2014-05-14 13:37:20 +04:00
parent e791436819
commit 68f65a9f7a

View File

@@ -111,7 +111,7 @@ class ExistValidator extends Validator
$query = $this->createQuery($targetClass, $params);
if (is_array($object->$attribute)) {
if ($query->count("DISTINCT [[$targetAttribute]]") === count($object->$attribute)) {
if ($query->count("DISTINCT [[$targetAttribute]]") == count($object->$attribute)) {
return;
}
} elseif ($query->exists()) {