RoR 中是否存在 OR 运算符?我想要或实现这样的东西:
Model.where('cat_id' => 5 OR 'color' => 'grey').all
我想我必须使用 find_by_sql
nop 吗?
最佳答案
我相信是这样的:
Model.where('cat_id=? OR color=?', 5, 'grey')
关于ruby-on-rails - Active Record 中的“或”运算符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6411931/