Clean up arg handling for notification worker (#37587)

This commit is contained in:
Claire authored and GitHub committed 2026-01-27 15:59:51 +00:00
1 parent 48c102aabe
commit a20519d671
1 file changed
+3 -8
+3 -8
View File
@@ -3,14 +3,9 @@
class LocalNotificationWorker
include Sidekiq::Worker
def perform(receiver_account_id, activity_id = nil, activity_class_name = nil, type = nil, options = {})
if activity_id.nil? && activity_class_name.nil?
activity = Mention.find(receiver_account_id)
receiver = activity.account
else
receiver = Account.find(receiver_account_id)
activity = activity_class_name.constantize.find(activity_id)
end
def perform(receiver_account_id, activity_id, activity_class_name, type = nil, options = {})
receiver = Account.find(receiver_account_id)
activity = activity_class_name.constantize.find(activity_id)
# For most notification types, only one notification should exist, and the older one is
# preferred. For updates, such as when a status is edited, the new notification