Run rails code after an update to the database has commited, without after_commit
问题 I'm trying to battle some race cases with my background task manager. Essentially, I have a Thing object (already exists) and assign it some properties, and then save it. After it is saved with the new properties, I queue it in Resque, passing in the ID. thing = Thing.find(1) puts thing.foo # outputs "old value" thing.foo = "new value" thing.save ThingProcessor.queue_job(thing.id) The background job will load the object from the database using Thing.find(thing_id) . The problem is that we've