Inline, no need to duplicate the conditional

This commit is contained in:
Jorge Manrubia
2025-04-23 15:37:28 +02:00
parent 6f98f2f573
commit b4cfd40a2f
+2 -13
View File
@@ -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