I am getting this error for a delayed job on a class method:
FAILED (0 prior attempts) with NoMethodError: undefined method `prefix' for #<Object:0x007f9801e1d548>
This is the async method:
class << self
def new_request(users, api_client)
api_client.create_async_call({
subject: 'subject',
body: 'body',
recipients: [user1, user2...]
})
end
handle_asynchronously :new_request
end
And I'm calling the method this way:
Notification.new_catalog_request(users, api_client)
I've looked at the README file on delayed jobs and looked at the other stackoverflow answers and none of them have worked.
What do I need to do to get this async job to run?
The odds are your api_client isn't being properly serialized and de-serialized in the job. You might have better luck passing in the necessary data, and re-instantiating the api_client object from within the job instead of depending on the serialized version.