You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 31, 2018. It is now read-only.
class MyModel ...
after_save do
run_after_commit { puts "run after commit called" }
end
end
MyModel.transaction do
model1 = MyModel.find(1)
model1.title = "1"
model1.save!
model2 = MyModel.find(1) # same "record"
model2.title = "2"
model2.save!
end
Output is only a single:
run after commit called
If we'd instead save the queue within the transaction object.