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
Hi!
I'm seeing that the after restore callback is getting run before the update commit.
gem 'paranoia', '~> 2.4'
class Flag < ApplicationRecord
acts_as_paranoid
after_restore :my_callback
def my_callback
p 'hi'
end
end
[7] pry(main)> flag.restore!
(0.3ms) BEGIN
SQL (0.5ms) UPDATE "flags" SET "deleted_at" = NULL, "updated_at" = '2018-10-28 12:55:34.948615' WHERE "flags"."id" = $1 [["id", 15]]
'hi'
(5.9ms) COMMIT
In my real callback I'm enqueuing a job that when executes it looks for the record in the db again, and if the job starts fast enough the state of the record is not yet updated.
Is this the expected behaviour for this callback? How can I get an after restore commit callback?
Thank you!
The text was updated successfully, but these errors were encountered:
Hi!
I'm seeing that the after restore callback is getting run before the update commit.
gem 'paranoia', '~> 2.4'
In my real callback I'm enqueuing a job that when executes it looks for the record in the db again, and if the job starts fast enough the state of the record is not yet updated.
Is this the expected behaviour for this callback? How can I get an after restore commit callback?
Thank you!
The text was updated successfully, but these errors were encountered: