范围:new_users,:conditions => {['看起来IS NULL或看起来=?',false]}获取错误

时间:2013-02-23 19:32:24

标签: ruby-on-rails ruby-on-rails-3

我的范围是

scope :new_users, :conditions => {['look IS NULL OR look = ?',false]}

但我收到错误消息:

syntax error, unexpected '}', expecting tASSOC

我哪里错了?请纠正它。我正在使用rails3.2

2 个答案:

答案 0 :(得分:0)

你可以试试这个

scope :new_users, where('look IS NULL OR look = ?', false)

答案 1 :(得分:0)

修改您的范围,如:

scope :new_users, :conditions => {('look IS NULL OR look = ?',false)}