Files
fizzy/app/models/notifier/card_event_notifier.rb
T
Jason Zimdars c4dec29b49 Assignment notifications should always be delivered
- They're effectively @mentions
- This means watching really reflects the UI state: Watching for new cards
2025-09-11 21:21:11 -05:00

23 lines
614 B
Ruby

class Notifier::CardEventNotifier < Notifier
delegate :creator, to: :source
delegate :watchers_and_subscribers, to: :card
private
def recipients
case source.action
when "card_assigned"
source.assignees.excluding(creator)
when "card_published"
watchers_and_subscribers(include_only_watching: true).without(creator, *card.mentionees)
when "comment_created"
watchers_and_subscribers.without(creator, *source.eventable.mentionees)
else
watchers_and_subscribers.without(creator)
end
end
def card
source.eventable
end
end