gpt4 book ai didi

ruby-on-rails - 警告: Time#succ is obsolete; use time + 1

转载 作者:行者123 更新时间:2023-12-04 04:00:21 25 4
gpt4 key购买 nike

这是什么错误呢?我正在运行这样的标准查询:

time_range = (1.month.ago.beginning_of_month..1.month.ago.end_of_month)


Feed.find(:all, :conditions => ['created_at = ? AND id not in (?)', time_range, [1,2,3]]).count

有任何想法吗?谢谢

最佳答案

我遇到了这个问题,解决方案是添加“to_date”,以便在几天内进行迭代,如下所示:

time_range = (1.month.ago.beginning_of_month.to_date..1.month.ago.end_of_month.to_date)

关于ruby-on-rails - 警告: Time#succ is obsolete; use time + 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10657798/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com