Don't track assignment notifications until publishing
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user