Method: ROM::SQL::Relation::Reading#invert

Defined in:
lib/rom/sql/relation/reading.rb

#invertRelation

Inverts the current WHERE and HAVING clauses. If there is neither a WHERE or HAVING clause, adds a WHERE clause that is always false.

Examples:

users.exclude(name: 'Jane').invert

# this is the same as:
users.where(name: 'Jane')

Returns:



443
444
445
# File 'lib/rom/sql/relation/reading.rb', line 443

def invert
  new(dataset.invert)
end