[Help] How to pass multiple arguments to a method in a worker?

Hi, guys,
I ran into a problem while I tried to pass more than one parameters to a
method in the worker class, it fails, from the backgroundrb log, I found

You have a nil object when you didn’t expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

Seems the args is nil, but a hash I passed in my controller. From the
it should be a hash if there are multiple arguments. Here’s what I did:

In my controller:
def blah
MiddleMan.worker(:hard_worker).send_mail(:args => {:recipient =>
[email protected]’, :subject => ‘BlahBlah’})

In my worker class:
def send_mail(args)
emailer.send_mail(args[:recipient], args[:subject])

Is there anything wrong?

Additional info:
backgroundrb 1.0.4

All the best,
Hao Liu

Hao Liu wrote:

MiddleMan.worker(:hard_worker).send_mail(:args => {:recipient =>
[email protected]’, :subject => ‘BlahBlah’})

Just send the parameters as a single hash:

send_mail(:recipient => ‘[email protected]’, :subject => ‘BlahBlah’)

Rails Wheels - Find Plugins, List & Sell Plugins -