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.
我似乎无法在任何地方找到答案。我知道我可以做到:
Item.where(:color => 'red')
获取所有红色项目,但是如何获取所有颜色不是红色的项目?
它是旧学校格式和新 Arel 格式的混合体。
Item.where("color != ?", 'red')