I would like to queue the method upload_to_scribd (from the gem scribd_fu) using delayed_job.
Is there any way I can do this without modifying the gem itself?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You shouldn’t have to do anything special to get this to work. For example, you can do probably do something like this:
If you want you can also wrap this in a function or model of your own:
P.S: I don’t know if my syntax for the calls to the ScribdFu gem are correct, but you should be able to use the delay method in this way to queue the delayed job.
To accomplish what you want in your comment, create a file called (config/initializers/delay_scribd.rb) and add the following to it:
This will mean that any time this function is called it will be called in a delayed job, without having to explicitly call delay on the method.
end