From 5ba3fed56c08977bf5a174a1eed17103fc89d662 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sat, 26 Mar 2022 18:37:55 +0100 Subject: [PATCH] Replace usage of `answer` in `before_destroy` of Reaction with `parent` --- app/models/appendable/reaction.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/appendable/reaction.rb b/app/models/appendable/reaction.rb index 77d2726b..fc253fc3 100644 --- a/app/models/appendable/reaction.rb +++ b/app/models/appendable/reaction.rb @@ -10,7 +10,7 @@ class Appendable::Reaction < Appendable before_destroy do Notification.denotify parent.user, self unless parent.user == user user.decrement! :smiled_count - answer.decrement! :smile_count + parent.decrement! :smile_count end def notification_type(*_args)