Files
fizzy/app/models/notifier/event_notifier.rb
T
Jorge Manrubia 54f4bd5144 Generalize event's cards as eventable,add collection
Lots to tidy up but this is working
2025-04-24 12:28:16 +02:00

23 lines
620 B
Ruby

class Notifier::EventNotifier < Notifier
delegate :creator, to: :source
delegate :watchers_and_subscribers, to: :card
private
def recipients
case source.action
when "assigned"
source.assignees.excluding(source.collection.access_only_users)
when "published"
watchers_and_subscribers(include_only_watching: true).without(creator, *card.mentionees)
when "commented"
watchers_and_subscribers.without(creator, *source.comment.mentionees)
else
watchers_and_subscribers.without(creator)
end
end
def card
source.eventable
end
end