23 lines
535 B
Ruby
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
|