From ccaa052d575d969fbd92ef7f959b1ddc23f01823 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Fri, 9 May 2014 18:57:00 +0400 Subject: [PATCH] ExistValidator count logic fix --- framework/validators/ExistValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/validators/ExistValidator.php b/framework/validators/ExistValidator.php index 4a88e675e8..777231f08b 100644 --- a/framework/validators/ExistValidator.php +++ b/framework/validators/ExistValidator.php @@ -93,7 +93,7 @@ class ExistValidator extends Validator $query = $this->createQuery($targetClass, $params); if (is_array($object->$attribute)) { - if ($query->count() === count($object->$attribute)) { + if ($query->count() >= count($object->$attribute)) { return; } } elseif ($query->exists()) {