FIX: Only perform logic on create commits

This commit is contained in:
Robin Ward 2019-04-04 16:59:56 -04:00
parent 2c7a50860f
commit 8af7237092

View File

@ -32,7 +32,7 @@ class Reviewable < ActiveRecord::Base
log_history(:created, created_by)
end
after_commit do
after_commit(on: :create) do
DiscourseEvent.trigger(:reviewable_created, self)
Jobs.enqueue(:notify_reviewable, reviewable_id: self.id) if pending?
end