Does Rails 4 have support for OR queries

前端 未结 7 1920
暗喜
暗喜 2020-12-08 13:14

So in Rails 4 the long desired feature to use not queries has been added.

Article.where.not(title: \'Rails 3\')

Has similar su

7条回答
  •  既然无缘
    2020-12-08 13:47

    I know that this is an old thread, but anyone else looking for a solution to this problem might find this code helpful:

    Article.where(title: ["Rails 3", "Rails 4"])
    

    Maybe that will help you get someone going in the right direction without having to risk sql injection.

提交回复
热议问题