ddb
ddb

Reputation: 1406

Rails 3.1 - Events based on time

I have an 'Event' model that contains a list of events along with their start time.

When the current time reaches the event start time, I would like to fire some action.

In other words, I want to do something whenever an event starts.

How can I accomplish this in Ruby / Rails ?

Upvotes: 0

Views: 1235

Answers (1)

davidb
davidb

Reputation: 60

There are two ways to deal with this. Either you write a script that checks the Events permanently and triggers some action when the event date is in the past or you use a gem for that. I would suggest you to watch some of the background job screencasts that deal with your problem:

http://railscasts.com/?tag_id=32

Upvotes: 1

Related Questions