如何使条件包含零值

时间:2015-03-02 04:15:12

标签: ruby-on-rails ruby ruby-on-rails-4

我找到ActiveRecord,漏斗值不是“输入”值

我做 where condition

这是我的代码

@calls = Call.searchable.where.not(funnel: "input") 

这些命令工作正常,但结果也是零值

我只想漏斗不是'输入'

如何在where语句

中添加OR条件

SQL语句是

select * from call where is_visible = 1 and (funnel != 'input or funnel is null)

2 个答案:

答案 0 :(得分:1)

吹码可以帮到你。

@calls = Call.searchable.where("funnel != 'input' or funnel is null")

答案 1 :(得分:0)

如果值是动态的,这也将起作用

Call.searchable.where("funnel != ? OR funnel is ?”,@value1, nil)
相关问题