Reputation: 89203
I want to run the method process_images
asynchronously after_save
with Delayed::Job
. However, when I try:
after_save lambda { send_later(:process_images) }
I get a NoMethodError: You have a nil object when you didn't expect it!
. (self.send_later(:process_images)
work either)
Upvotes: 0
Views: 1561
Reputation: 66
This may work... I do remember using it a while back before switching to Delayed::Job.enqueue instead:
after_save do |image|
image.send_later(:process_images)
end
You could also try:
after_save :cue_process_images
def cue_process_images
send_later(:process_images)
end
I'm currently using something similar to the later, using paperclip and it works fine.
Upvotes: 5