From b4cfd40a2fd1446b4c867bf291f840faa53585a1 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Wed, 23 Apr 2025 15:37:28 +0200 Subject: [PATCH] Inline, no need to duplicate the conditional --- app/models/notifier/event.rb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/app/models/notifier/event.rb b/app/models/notifier/event.rb index fb32d4178..0fc31914a 100644 --- a/app/models/notifier/event.rb +++ b/app/models/notifier/event.rb @@ -8,22 +8,11 @@ class Notifier::Event < Notifier when "assigned" source.assignees.excluding(card.collection.access_only_users) when "published" - watchers_and_subscribers(include_only_watching: true).without(creator, *mentionees) + watchers_and_subscribers(include_only_watching: true).without(creator, *card.mentionees) when "commented" - watchers_and_subscribers.without(creator, *mentionees) + watchers_and_subscribers.without(creator, *source.comment.mentionees) else watchers_and_subscribers.without(creator) end end - - def mentionees - case source.action - when "published" - source.card.mentionees - when "commented" - source.comment.mentionees - else - [] - end - end end