how to select distinct with an include?

Nice. Certainly more readable than my attempt.

Although the central issue here is we are using today as the starting
point - Chris was looking to use the start of the year.
What is missing is a "" method. I guess it would
be easy to add "start_of_day/week/month" methods as well to help with
these sorts of calculations. Then:
Time.mktime(2006,01,01) + 50.weeks
becomes + 50.weeks.

Slightly better..

My other thought was:>1, :mday=>1, :hour=>0).in(50.weeks)

Not as readable, but works and essentially captures the code for


irb(main):024:0> (Time.local( + 50.weeks).monday
=> Mon Dec 11 00:00:00 -0500 2006
irb(main):025:0> (Time.local( - 4.weeks).monday
=> Mon Nov 28 00:00:00 -0500 2005