From 235148952302eb236c5d112e444147dc9c4121b7 Mon Sep 17 00:00:00 2001 From: KMY Date: Mon, 27 Feb 2023 16:59:30 +0900 Subject: [PATCH] Fix remove emoji reactions bulk --- app/services/un_emoji_react_service.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/services/un_emoji_react_service.rb b/app/services/un_emoji_react_service.rb index d13b8fd2a9..69b1a93929 100644 --- a/app/services/un_emoji_react_service.rb +++ b/app/services/un_emoji_react_service.rb @@ -9,7 +9,11 @@ class UnEmojiReactService < BaseService @account = Account.find(account_id) @status = Status.find(status_id) + p '==================================== DEBUG' + p emoji_reaction + if emoji_reaction + emoji_reaction.destroy! create_notification(emoji_reaction) if !@account.local? && @account.activitypub? notify_to_followers(emoji_reaction) if @account.local? write_stream(emoji_reaction) @@ -22,8 +26,8 @@ class UnEmojiReactService < BaseService private def bulk(account, status) - EmojiReaction.where(account: account).where(status: status).tap do |emoji_reaction| - call(account, status, emoji_reaction) + EmojiReaction.where(account: account).where(status: status).each do |emoji_reaction| + call(account.id, status.id, emoji_reaction) end end