Setting Up Reminders

I was hoping to get some advice on something I am trying to build.

I want to be able to allow users to be able to set up reminders. They will be allowed to choose to have reminders either once a day (or more than once) at particular times, reminders every other day, every wednsday, etc all though at specific times of the day (for example a reminder at 9AM every Tuesday). I would like to have some sort of cron job running to check what reminders need to be sent. I was hoping to get advice on what plugins might be useful and any othe advice on setting this up. still learning the ropes of rails. :slight_smile:

Thanks!

I was hoping to get some advice on something I am trying to build.

I want to be able to allow users to be able to set up reminders. They will be allowed to choose to have reminders either once a day (or more than once) at particular times, reminders every other day, every wednsday, etc all though at specific times of the day (for example a reminder at 9AM every Tuesday). I would like to have some sort of cron job running to check what reminders need to be sent. I was hoping to get advice on what plugins might be useful and any othe advice on setting this up. still learning the ropes of rails. :slight_smile:

You might find these useful...

http://runt.rubyforge.org/ Runt is an implementation of select temporal patterns

http://chronic.rubyforge.org/ Chronic is a natural language date/time parser written in pure Ruby.

That is great.

I would like to use Runt and represent the object the object in a database when i need it for future use. Any suggestions on how to represent this? There are only a finite number of things i need to be able to account for and not the full possibilities offered by the gem.

I am currently representing the reminder in my database as seperate fields; one for hour and minute then if needed one for the day and month if the type of reminder requires it. The reminders can be a daily one, weekly, or monthly.

So. if the reminder is a daily one then all i will need is the hour and minute

if it is weekly, i need hour, minute, and day

if it is monthly, i need hour, minute, day, and which week (first, second, third, etc)

i am trying to figure out how to best store this information in my database. i have stored each serately for the time being. can i store it as datetime and then just use portions of datetime that i need?

thanks, tashfeen

When I've done this sort of thing in the past I've used a time unit
key and an integer representing quantity. Thus you'd have quantity as
2 and time unit key as 'year' then you simply send the time unit key
as a message to the fixnum. Ie quantity.send(time_unit_key) and rails
built in time helper type extensions reply with an appropriate value
when added to time objects etc.

Blog: http://random8.zenunit.com/ Learn: http://sensei.zenunit.com/ Twitter: http://twitter.com/random8r