Inline, no need to duplicate the conditional
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user