where.not

suggest change

where clauses can be negated using the where.not syntax:

class Person < ApplicationRecord#attribute :first_name, :stringendpeople = Person.where.not(first_name: ['Mark', 'Mary'])# => SELECT "people".* FROM "people" WHERE "people"."first_name" NOT IN ('Mark', 'Mary')

Supported by ActiveRecord 4.0 and later.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


ActiveRecord:
*where.not

Table Of Contents
2ActiveRecord
55CSV