I need to automatically change a record in my database on a specific date and time.
Example: When the date and time is 01/12/2012 17:15:00 I want some record to automatically be set to 1. Is there any solution to this?
(I am using Rails 3.2.6)
Update 30.11.12 – 13:06
The real problem is that I have a datetime record in my database, when the date and time in this record exceeds todays date and time – then I want another record to be set to 1. Is there any way I can make an if statement, or something, somewhere in my controller?
You could use whenever https://github.com/javan/whenever to set up a cron job for you
Whenever has an easy syntax in its
schedule.rbfile to let you run tasks “whenever” you likeFrom their readme: