Using Ruby on Rails 2.3.8, I'm wondering how to represent a schedule for model that handles "reminders".
Examples of reminder:
"Must do ABC", Remind me in 3 days
"Must do DEF", Remind me in 5 weeks
"Must do XYZ", Remind me on 2nd Oct 2010 at 5 pm
So, the Must do...
goes into a description
column.
But how to deal with the fact that when to remind
can have different types of values?
Some things I thought of:
I was thinking of creating a column for each type (remind_in_days, remind_in_weeks, remind_at)
-->But this feels a bit kludgy.Have a field called remind_type which will be used to determine the type of value stored in a field called remind_type_value
-->If I use this approach, is there a way that I can simply say in Rails code something like Reminder.RemindValue without having to use code likeif remind_type==x then x
??
Any ideas of how I should proceed (in a manner that is possibly elegant)?