嘿人們試圖做一個簡單的查詢,我發現所有記錄的特定屬性爲零。在這種情況下...Rails where子句不等於零
irb(main):009:0> Registration.where(:registration_cancellation_token != nil)
Registration Load (0.2ms) SELECT `registrations`.* FROM `registrations` WHERE (1)
=> [#<Registration id: 1, orientation_id: 13, first_name: "mark", last_name: "Busta", email: "[email protected]", student_id: "3232333", phone: "3884448333", registration_cancellation_token: nil, registration_cancelled_at: nil, checked_in: false, created_at: "2014-02-20 13:46:31", updated_at: "2014-02-20 13:46:31">]
...但查詢返回所有註冊。感謝所有幫助...
可惜你不能做一個漂亮的方式(至少不能以'軌3.2'以下) – xlembouras