Module: ROM::SQL::Plugin::Nullify

Defined in:
lib/rom/sql/plugin/nullify.rb

Overview

Nullify relation by

Instance Method Summary collapse

Instance Method Details

#nullifySQL::Relation

Returns a relation that will never issue a query to the database. It implements the null object pattern for relations.

Examples:

result will always be empty, regardless if records exists

users.where(name: 'Alice').nullify

Returns:

See Also:



16
17
18
# File 'lib/rom/sql/plugin/nullify.rb', line 16

def nullify
  where { `1 = 0` }
end