We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a4ce73 commit ccda156Copy full SHA for ccda156
1 file changed
lib/sync/model.rb
@@ -39,13 +39,13 @@ def sync(*actions)
39
actions.flatten!
40
41
if actions.include? :create
42
- after_create :publish_sync_create, if: -> { Sync::Model.enabled? }
+ after_commit :publish_sync_create, on: :create, if: -> { Sync::Model.enabled? }
43
end
44
if actions.include? :update
45
- after_update :publish_sync_update, if: -> { Sync::Model.enabled? }
+ after_commit :publish_sync_update, on: :update, if: -> { Sync::Model.enabled? }
46
47
if actions.include? :destroy
48
- after_destroy :publish_sync_destroy, if: -> { Sync::Model.enabled? }
+ after_commit :publish_sync_destroy, on: :destroy, if: -> { Sync::Model.enabled? }
49
50
51
0 commit comments