Use current_user to avoid looking up the user again via the reaction (#4592)

This commit is contained in:
Molly Struve 2019-10-25 12:40:33 -05:00 committed by Mac Siri
parent b70186af0b
commit 7943aa0280

View file

@ -49,7 +49,7 @@ class ReactionsController < ApplicationController
category: category,
).first
if reaction
reaction.user.touch
current_user.touch
reaction.destroy
Notification.send_reaction_notification_without_delay(reaction, reaction.reactable.user)
Notification.send_reaction_notification_without_delay(reaction, reaction.reactable.organization) if organization_article?(reaction)