DataMapper更新后日期范围无效

时间:2013-12-17 17:17:57

标签: ruby datamapper activesupport padrino

def start_of_this_week
  today = Date.today
  today - today.cwday + 1
end

def end_of_this_week
  today = Date.today
  start = today - today.cwday + 1
  endday = start + 6
end

rr = ReportRecord.first(:pupil => pupil,
                        :report => report,
                        :created_at => start_of_this_week..end_of_this_week)

昨天代码工作得很好,但是在更新后它开始没有说:

  

/ dashboard上的TypeError   无法从DateTime迭代

可能是什么问题? 我试过(start_of_this_week..end_of_this_week)是一个范围,所以应该没问题。

ReportRecord模型也在使用DataMapper。

0 个答案:

没有答案