Wondering what would be the best way to implement this.

I need to store that an item occurs on a specific day of the week or
everyday.
Say in the model we have a title and a day of week.
I was thinking doing a 0-7 in my model for the item representing the
day of the week with zero being everyday.

For a selection criteria say I wanted to search for every title
starting on Monday, Wendsday and Friday where each day on the
selection screen would be checkbox representing the days Monday -
Sunday and Everyday (clicking everyday would remove the checkboxes
should someone select everyday and a day of the week)

What would the active record query look like to dynamically pass in
the days of the week selected should say mon, wed and fri get selected
given that what they selected is past to the controller in a
"days_of_week" variable.

I'm not totally tied to the idea of storing the day as a number so if
anyone has any better implementations of this I'm listening.


Cheers,
S Gallo

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to