Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何编写一个 where 子句,其中我有一个可以采用多个选项的 where 参数。例如,
User.where(name: "Jason" OR name: "Bob")
虽然我知道这不是正确的语法,但什么是正确的?
虽然我没有要检查的控制台,但我很确定它是:
User.where(name: ["Jason", "Bob"])
我参加聚会总是迟到...
friends = User.where(:name => ["Jason", "Bob"])
(导轨 4.0.0)