Matt, good call there mate.

I created some constants for each week start and end:

WEEK_ONE_START = "2009-06-21"
WEEK_ONE_END = "2009-06-27"

And then defined that in a per search scope:

named_scope :compiled_week_one, lambda { { :conditions => ['compiled_on 
> ? and compiled_on < ?', WEEK_TWO_START, WEEK_TWO_END] } }

And can do that for each of the weeks of the season (13 in total).  I 
also have a default scope using Time.now.beginning_of_week and 
Time.now_end_of_week for current records but the form search allows the 
new scopes and all works well.

Many thanks.

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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-talk@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