问题
I am using delayed_job successfully like:
Mailer.delay(run_at: 1.minutes.from_now).my_mail(my model)
I would like to set the minutes with an attribute, in this case called :frequency . i have tried with :frequency/frequency:/(frequency)/[frequency][:frequency]
one of the errors I'm getting is
undefined method `minutes' for :frequency:Symbol
Is what I'm trying to do possible? or should i do something else? How should i do it? Thanks for your help.
回答1:
Try:
frequency = 10
"#{frequency}".to_i.minute.from_now
来源:https://stackoverflow.com/questions/27582269/delayed-job-how-to-set-delayrun-at-from-attribute-time-from-now