【发布时间】:2017-02-11 15:53:36
【问题描述】:
我正在创建一个带有过期特价商品的 Rails 应用程序。每次有人登录时,我都有一个 Def 查找已经过期的特价,然后删除。它在本地运行良好,但是当我将其部署到 heroku 时,出现此错误:
ActiveRecord::StatementInvalid (PG::UndefinedFunction: ERROR: operator does not exist: character varying <= numeric
和提示:
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
这是我创建的定义。我在应用程序控制器中为 def 添加了一个 before_filter
def check_expired
time = DateTime.now.to_f.to_s
@specials = Special.where("expires <= #{DateTime.now.to_f.to_s}")
@specials.destroy_all
end
【问题讨论】:
标签: ruby-on-rails postgresql heroku