修复Arel错误ActiveRecord :: StatementInvalid(PG :: UndefinedFunction:错误:运算符不存在:没有时区的时间戳=整数

时间:2020-03-27 11:56:28

标签: ruby-on-rails arel

尝试执行Arel查询。在我的参数中 {"node"=>"firstSeenAt", "rule"=>"hasAnyValue", "value"=>""},其中first_seen_at是我的visitors表中的一列

def table
   visitors.arel_table
end
def rule_has_any_value
   visitors.where(table["#{column}"].not_in_any(["", nil, 0]))
end

保持在我的Rails控制台中

ActiveRecord::StatementInvalid (PG::UndefinedFunction: ERROR:  operator does not exist: timestamp without time zone = integer
LINE 1: ... IN (NULL) OR "visitors"."first_seen_at" NOT IN (0)) OR...
                                                             ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.
):

这里有什么问题的指针吗?谢谢。

0 个答案:

没有答案
相关问题