Forum: Ruby on Rails Setting Up Reminders

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
tashfeen.ekram (Guest)
on 2009-03-30 04:49
(Received via mailing list)
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. :)


Thanks!
Philip H. (Guest)
on 2009-03-30 06:59
(Received via mailing list)
> 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. :)

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.
tashfeen.ekram (Guest)
on 2009-04-06 03:43
(Received via mailing list)
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.
tashfeen.ekram (Guest)
on 2009-05-04 16:17
(Received via mailing list)
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
Julian L. (Guest)
on 2009-05-05 15:29
(Received via mailing list)
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

On 04/05/2009, at 10:16 PM, "tashfeen.ekram"
This topic is locked and can not be replied to.