title: Delayed_job in rails failing
body: <p>I am just beginning to look into using the delayed_job gem.</p>
  
  <p>To test it, I added "delayed" to the welcome email function and changed that call from</p>
  
  <pre><code>    UserMailer.welcome_email(self).deliver
  </code></pre>
  
  <p>to </p>
  
  <pre><code>UserMailer.delay.welcome_email(self)
  </code></pre>
  
  <p>This is called inside the User model after_create. I see an entry show up in the delayed_job table after the function executes. Now when I run "rake jobs:work" on command line the task starts but gives errors as below</p>
  
  <pre><code>[Worker(host:Sanjay-PC pid:7008)] Starting job worker
  [Worker(host:Sanjay-PC pid:7008)] Class#welcome_email failed with NoMethodError: undefined method `welcome_email' for #&lt;Class:0x4871d60&gt; - 0 failed attempts
  [Worker(host:Sanjay-PC pid:7008)] 1 jobs processed at 0.0939 j/s, 1 failed ...
  </code></pre>
  
  <p>Thinking that if I changed the welcome_email method declaration to a Class method as </p>
  
  <pre><code> def self.welcome_email(user)
  </code></pre>
  
  <p>(added self. in front) that might help. But then when I run rake jobs:work I get the following error</p>
  
  <pre><code>rake aborted!
  undefined method `welcome_email' for class `UserMailer'
  C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method'
  C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method_chain'
  C:/Ruby192/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.4/lib/delayed/message_sending.rb:50:in `handle_asynchronously'
  c:/mgn/mgn-r3/app/mailers/user_mailer.rb:10:in `&lt;class:UserMailer&gt;'
  c:/mgn/mgn-r3/app/mailers/user_mailer.rb:1:in `&lt;top (required)&gt;'
  C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:454:in `load'
  &lt;Stack truncated&gt;
  </code></pre>
  
  <p>It seems to now know the class as UserMailer but it somehow doesn't see the class method welcome_email.</p>
  
  <p>I am on Rails 3.0.5, Ruby 1.9.2p180 and the installed delayed_job gem is 2.1.4 - on Windows</p>
  
  <p>Can't seem to find any related answers anywhere.</p>
  
  <p>Thanks for your thoughts.</p>
  
  <p>-S</p>
  
  <p>Adding UserMailer code per @pjammer's request</p>
  
  <pre><code>class UserMailer &lt; ActionMailer::Base
    default :from =&gt; "from@example.com"
  
    def welcome_email(user)
      @user = user
      @url  = "http://example.com/login"
      mail(:to =&gt; user.email,
           :subject =&gt; "Welcome to My Awesome Site")
    end
  end
  </code></pre>