src/Validators/UniqueValidator.php
public function validateAttribute($model, $attribute)
    {
        /* @var $targetClass ActiveRecordInterface */
        $targetClass = $this->getTargetClass($model);
        $targetAttribute = $this->targetAttribute === null ? $attribute : $this->targetAttribute;
        $rawConditions = $this->prepareConditions($targetAttribute, $model, $attribute);
        $conditions = [$this->targetAttributeJunction === 'or' ? 'or' : 'and'];

        foreach ($rawConditions as $key => $value) {
            if (is_array($value)) {
                $this->addError($model, $attribute, Reaction::t('rct', '{attribute} is invalid.'));
                return resolve(false);
            }
            $conditions[] = [$key => $value];
        }

        return $this->modelExists($targetClass, $conditions, $model)
            ->then(function() use ($targetAttribute, $attribute, $model) {
                if (is_array($targetAttribute) && count($targetAttribute) > 1) {
                    $this->addComboNotUniqueError($model, $attribute);
                } else {
                    $this->addError($model, $attribute, $this->message);
                }
                return null;
            }, function() {
                return null;
            });
    }
public function validateAttribute($model, $attribute)
    {
        /* @var $targetClass ActiveRecordInterface */
        $targetClass = $this->getTargetClass($model);
        $targetAttribute = $this->targetAttribute === null ? $attribute : $this->targetAttribute;
        $rawConditions = $this->prepareConditions($targetAttribute, $model, $attribute);
        $conditions = [$this->targetAttributeJunction === 'or' ? 'or' : 'and'];

        foreach ($rawConditions as $key => $value) {
            if (is_array($value)) {
                $this->addError($model, $attribute, Reaction::t('rct', '{attribute} is invalid.'));
                return resolve(false);
            }
            $conditions[] = [$key => $value];
        }

        return $this->modelExists($targetClass, $conditions, $model)
            ->then(function() use ($targetAttribute, $attribute, $model) {
                if (is_array($targetAttribute) && count($targetAttribute) > 1) {
                    $this->addComboNotUniqueError($model, $attribute);
                } else {
                    $this->addError($model, $attribute, $this->message);
                }
                return null;
            }, function() {
                return null;
            });
    }
{@inheritdoc}