c4dec29b49
- They're effectively @mentions - This means watching really reflects the UI state: Watching for new cards
23 lines
614 B
Ruby
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
|