views:

36

answers:

0

I'm using delayed_job and for a method I keep getting this error: undefined method 'shorten!' for #<Status:0x6ce8c6c>

Delayed_job works for my other methods such as sending users a confirmation email when they sign up. This is the only method thats giving me the error. The method works when called on directly but it spouts out that error when I use delayed job.

class Status < ActiveRecord::Base
 belongs_to :user

 def shorten!
  self.link = shorten_with_bitly(self.link)
  save
 end
end

The following works:

@status.shorten!

The following gives the undefined method error:

@status.send_later(:shorten!)

I'm using Rails version 2.3.5 if that makes a difference.

Thanks!