From 2272ed1b7c67c3556149b3f7af678d69497ab47a Mon Sep 17 00:00:00 2001 From: yarik Date: Mon, 29 Aug 2016 11:29:38 +0300 Subject: [PATCH] Ratingbehavior fix. --- common/behaviors/RatingBehavior.php | 2 ++ common/models/Articles.php | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/common/behaviors/RatingBehavior.php b/common/behaviors/RatingBehavior.php index 0d999ca..2200f4f 100755 --- a/common/behaviors/RatingBehavior.php +++ b/common/behaviors/RatingBehavior.php @@ -21,6 +21,8 @@ { return [ ActiveRecord::EVENT_AFTER_UPDATE => 'afterUpdate', + ActiveRecord::EVENT_AFTER_DELETE => 'afterUpdate', + ActiveRecord::EVENT_AFTER_INSERT => 'afterUpdate', ]; } diff --git a/common/models/Articles.php b/common/models/Articles.php index 7dec7ed..09776c8 100755 --- a/common/models/Articles.php +++ b/common/models/Articles.php @@ -49,9 +49,6 @@ class Articles extends \yii\db\ActiveRecord 'out_attribute' => 'translit', 'translit' => true ], - [ - 'class' => RatingBehavior::className(), - ], ]; } -- libgit2 0.21.4