mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
It was causing side effects: https://github.com/yiisoft/yii2/issues/13453
This commit is contained in:
@ -161,7 +161,7 @@ class UniqueValidator extends Validator
|
||||
} else {
|
||||
// if current $model is in the database already we can't use exists()
|
||||
/** @var $models ActiveRecordInterface[] */
|
||||
$models = $query->select($targetClass::primaryKey())->limit(2)->all();
|
||||
$models = $query->limit(2)->all();
|
||||
$n = count($models);
|
||||
if ($n === 1) {
|
||||
$keys = array_keys($conditions);
|
||||
|
||||
Reference in New Issue
Block a user