diff --git a/ActiveQuery.php b/ActiveQuery.php index 7a765e9..2e15fde 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -339,9 +339,7 @@ class ActiveQuery extends Component implements ISqlBuilder { $sql = $this->builder->delete(); if ($getSql === FALSE) { - $result = (bool)$this->execute($sql, $this->attributes)->delete(); - $this->modelClass->optimize(); - return $result; + return (bool)$this->execute($sql, $this->attributes)->delete(); } return $sql; }