# Setting Up Reminders

**URL:** <https://www.ruby-forum.com/t/setting-up-reminders/164212>\
**Category:** Rails\
**Created:** [March 30, 2009, 2:49am UTC](https://www.ruby-forum.com/t/setting-up-reminders/164212 "2009-03-30T02:49:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tashfeen.ekram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@tashfeen.ekram](https://www.ruby-forum.com/u/tashfeen.ekram)\
**Post date:** [March 30, 2009, 2:49am UTC](https://www.ruby-forum.com/t/setting-up-reminders/164212/1 "2009-03-30T02:49:57Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![tashfeen.ekram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@tashfeen.ekram](https://www.ruby-forum.com/u/tashfeen.ekram)\
**Post date:** [March 30, 2009, 4:59am UTC](https://www.ruby-forum.com/t/setting-up-reminders/164212/2 "2009-03-30T04:59:31Z")

</div>

> 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/](http://runt.rubyforge.org/)  
Runt is an implementation of select temporal patterns

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

---

<div class="post-metadata">

**Author:** ![tashfeen.ekram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@tashfeen.ekram](https://www.ruby-forum.com/u/tashfeen.ekram)\
**Post date:** [April 6, 2009, 1:43am UTC](https://www.ruby-forum.com/t/setting-up-reminders/164212/3 "2009-04-06T01:43:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tashfeen.ekram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@tashfeen.ekram](https://www.ruby-forum.com/u/tashfeen.ekram)\
**Post date:** [May 4, 2009, 2:17pm UTC](https://www.ruby-forum.com/t/setting-up-reminders/164212/4 "2009-05-04T14:17:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tashfeen.ekram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@tashfeen.ekram](https://www.ruby-forum.com/u/tashfeen.ekram)\
**Post date:** [May 5, 2009, 1:29pm UTC](https://www.ruby-forum.com/t/setting-up-reminders/164212/5 "2009-05-05T13:29:06Z")

</div>

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/](http://random8.zenunit.com/)  
Learn: [http://sensei.zenunit.com/](http://sensei.zenunit.com/)  
Twitter: [http://twitter.com/random8r](http://twitter.com/random8r)

On 04/05/2009, at 10:16 PM, “tashfeen.ekram”
