[Backgroundrb-devel] Using my models

Dave Dupre gobigdave at gmail.com
Fri Dec 21 12:14:54 EST 2007

I'm working on upgrading my app to the latest version of backgroundrb.
Everything went find until I tried to execute my tasks.

Here is my simple worker for testing:

class MscWorker < BackgrounDRb::MetaWorker
  set_worker_name :msc_worker
  def create(args = nil)
    # this method is called, when worker is loaded for the first time
  # Send a message to everyone
  def send_message_to_all(args = nil)
    Message.send_to_everyone(args[:sender], args[:subject], args[:body],
    logger.error "MscWorker - #{err.class}: #{err}"

Called like so:
MiddleMan.ask_work(:worker => :msc_worker, :worker_method =>
:send_message_to_all, :data => { :sender => sender, :subject => subject,
:body => body })

I get lots of errors starting with this:
`load': undefined class/module User (ArgumentError)

I tried to require the classes in my worker file, and that will make some
errors go away, but it looks to want EVERY possible rails class or my model
required.  Something doesn't seem right here.  What do I need to do to use
my models?

Piston says I'm on revision 293.

Dave Dupre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20071221/246d647e/attachment.html 

More information about the Backgroundrb-devel mailing list