FIX: Only perform logic on `create` commits
This commit is contained in:
parent
2c7a50860f
commit
8af7237092
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue