Don't track assignment notifications until publishing

This commit is contained in:
Kevin McConnell
2025-02-06 15:10:59 +00:00
parent 321384b573
commit 469dbd0ba5
2 changed files with 8 additions and 2 deletions
+4
View File
@@ -11,6 +11,10 @@ module Bubble::Draftable
transaction do
published!
track_event :published
if assignments.any?
track_event :assigned, assignee_ids: assignee_ids
end
end
end
end
+4 -2
View File
@@ -7,8 +7,10 @@ module Bubble::Eventable
private
def track_event(action, creator: Current.user, **particulars)
event = find_or_capture_event_summary.events.create! action: action, creator: creator, bubble: self, particulars: particulars
event.generate_notifications_later
if published?
event = find_or_capture_event_summary.events.create! action: action, creator: creator, bubble: self, particulars: particulars
event.generate_notifications_later
end
end
def find_or_capture_event_summary