Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:28:16+00:00 2026-06-15T10:28:16+00:00

I need to automatically change a record in my database on a specific date

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:28:17+00:00Added an answer on June 15, 2026 at 10:28 am

    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.rb file to let you run tasks “whenever” you like

    From their readme:

    every 3.hours do
      runner "MyModel.some_process"
      rake "my:rake:task"
      command "/usr/bin/my_great_command"
    end
    
    every 1.day, :at => '4:30 am' do
      runner "MyModel.task_to_run_at_four_thirty_in_the_morning"
    end
    
    every :hour do # Many shortcuts available: :hour, :day, :month, :year, :reboot
      runner "SomeModel.ladeeda"
    end
    
    every :sunday, :at => '12pm' do # Use any day of the week or :weekend, :weekday
      runner "Task.do_something_great"
    end
    
    every '0 0 27-31 * *' do
      command "echo 'you can use raw cron syntax too'"
    end
    
    # run this task only on servers with the :app role in Capistrano
    # see Capistrano roles section below
    every :day, :at => '12:20am', :roles => [:app] do
      rake "app_server:task"
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a way to automatically format Date and Number objects based on locale
I need to restore a backup from a production database and then automatically reapply
I need to create a view that will automatically change from month to month
I need the keyboard change automatically from normal to numeric keyboard only for particular
I need to automatically change Google Maps marker icons based on the inner content
I need to automatically export figures from Matlab to PNG. My figure has a
I need to reset a MySQL Field value automatically at midnight. It is a
I need to create a page that will automatically create a thumbnail from all
I need to create a landing page that will automatically redirect a visitor to
I need to be able to write a script to automatically connect mysql in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.