Lets say I have a cronjob like this:
every 1.day, :at => '4:30 am' do
runner "MyModel.task_to_run_at_four_thirty_in_the_morning"
end
Although, I would like to make '1.day' more dynamic, such as changing the value via a form in an administration page.
Then it could look like this:
every Constant.find(2).value, :at => '4:30 am' do
or
@const = Constant.find(2)
every @const.span, :at => @const.time do
Can anyone come up with an idea on how to make this work?
Obviously, the reason for this would be that I could use the values stored in the database on my site, like an message saying
<%= "The next update is in less than #{@const.time}" #or something similar %>