Should you still pass only the object id when using ActiveJob?
问题 What are the pros and cons of doing the following in ActiveJob: Option A: // Controller MyJob.perform_later(object.id) // my_job.rb def perform(object_id) object = Object.find(object_id) // do stuff end Option B: // Controller MyJob.perform_later(object) // my_job.rb def perform(object) // do stuff end 回答1: ActiveJob now uses the new Globalid library behind the scenes to serialize/deserialize an ActiveRecord instance, therefore you can now pass an ActiveRecord object. I personally prefer to