1
2
3
4
has_many :expenses, :dependent => :destroy do
  def for_week(day)
    find(:all, :conditions => { :spent_at => day.to_time.beginning_of_week.to_date..(day.to_time.beginning_of_week.to_date + 6)})
...

Ruby Finding all in a date range...

by Barry Hess, November 02, 2007 15:15, 1 refactoring, tagged with date range, association proxy

So my User has an associati...

0218fde3a78fadbadb566bdb40d7b0dd Talk