Ruby on Rails - where not in ruby on rails- ruby on rails tutorial - rails guides - rails tutorial - ruby rails
where clauses can be negated using the where.notSyntax:
class Person < ApplicationRecord
#attribute :first_name, :string
end
people = Person.where.not(first_name: ['Mark', 'Mary'])
# => SELECT "people".* FROM "people" WHERE "people"."first_name" NOT IN ('Mark', 'Mary')