Named_scope with dates

Hi,

I want to create a named scope that returns all the line where date is
in X number of days.
This is how it looks

    named_scope :in, lambda { |number|
          { :conditions => ["event_date = ?", number.days.from_now] }
        }

My problem is that is compares the date with the hours, minutes and
seconds and just would to compare the day...
How do I do this?

Greg

I think this would work:

:conditions => ["event_date between ? and ?",
number.days.from_now.beginning_of_day,
number.days.from_now.end_of_day]

Regards

For MySql this would work

named_scope :in, lambda {|number|
  {:conditions => ["date(event_date) = ?",
number.days.from_now.to_date]}
}

Hope that helps.

Greg