mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 06:55:03 -05:00
FIX: Notify on Reviewable update. (#7980)
If a post is flagged after an action was already performed on it, it will update the previous Reviable instance and not create a new one. The notification logic was implemented in the :create callback which was completely skipped in this case.
This commit is contained in:
committed by
Régis Hanol
parent
6d3d08daad
commit
3008ecccbd
@@ -38,6 +38,9 @@ class Reviewable < ActiveRecord::Base
|
||||
|
||||
after_commit(on: :create) do
|
||||
DiscourseEvent.trigger(:reviewable_created, self)
|
||||
end
|
||||
|
||||
after_commit(on: [:create, :update]) do
|
||||
Jobs.enqueue(:notify_reviewable, reviewable_id: self.id) if pending?
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user