public function afterUpdate($event)
    {
        $oldCondition = [];
        $currentCondition = [];
        /** @var ActiveRecord $owner */
        $owner = $this->owner;
        foreach ((array)$this->conditionAttributes as $attribute) {
            if (!$owner->hasAttribute($attribute)) {
                continue;
            }
            $oldCondition[$attribute] = $currentCondition[$attribute] = $owner->getAttribute($attribute);
            if (array_key_exists($attribute, $event->changedAttributes)) {
                $oldCondition[$attribute] = $event->changedAttributes[$attribute];
            }
        }
        if (array_diff($currentCondition, $oldCondition) != []) {
            // condition was changed
            /** @var ActiveRecord $changedModel */
            $changedModel = Yii::createObject($owner->className());
            $changedModel->setAttributes($oldCondition, false);
            // recalculate old model range
            $changedModel->recalculateSort();
            // move model to top in new model range
            $owner->updateAttributes([
                $this->sortAttribute => $owner->find()->andWhere($this->getCondition())->count() - 1
            ]);
        }
    }