ActiveRecord:
*where.not
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.