1
我使用了一个名为范围,试图找到记录由1个月前,这里是我的代码有:查找记录由1个月前
scope :six, -> {:conditions["records.created_at > ?", 1.month.ago]}
和呼叫:
@sixmonths = human.human_logins.six
虽然我似乎得到以下错误:
`can't convert ActiveSupport::TimeWithZone into Intege`r
这发生在范围行上。
我是新来的范围,所以不知道我应该怎么做,任何想法都会很棒。