How to exclude an array of ids from query in Rails (using ActiveRecord)?

前端 未结 4 680
陌清茗
陌清茗 2020-12-13 07:13

I would like to perform an ActiveRecord query that returns all records except those records that have certain ids. The ids I would like excluded are stored in an array. So

4条回答
  •  时光说笑
    2020-12-13 07:39

    You can also use Squeel gem to accomplish such query. Documentation of it, goes here

提交回复
热议问题