I have the following snippet within my job:
before_enqueue do |job|
# do something
@car = create_car
end
before_perform do |job|
# do something
@car.update(type: 'broken')
end
but when the job is performed @car is a nil. Is it possible to pass somehow the instance variable from one callback to the second one? Even only ID would be fine. Cheers.
You would need to make this an instance variable off of
joband access that way:then