From fb1c2abc7e379bc9e41751796d82434084a28d99 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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/services/un_emoji_react_service.rb b/app/services/un_emoji_react_service.rb index 5a2e9eaf1..69b1a9392 100644 --- a/app/services/un_emoji_react_service.rb +++ b/app/services/un_emoji_react_service.rb @@ -9,10 +9,11 @@ class UnEmojiReactService < BaseService @account = Account.find(account_id) @status = Status.find(status_id) + p '==================================== DEBUG' + p emoji_reaction + if emoji_reaction - p '================================ DEBUG2 G' - emoji_reaction.destroy - p '================================ DEBUG2 H' + emoji_reaction.destroy! create_notification(emoji_reaction) if !@account.local? && @account.activitypub? notify_to_followers(emoji_reaction) if @account.local? write_stream(emoji_reaction) @@ -25,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