Files
fizzy/app/models/notifier/card_event_notifier.rb
T
2025-11-05 13:31:54 +01:00

23 lines
535 B
Ruby

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