Methods

Class/Module Index [+]

Quicksearch

DataMapper::Query::Conditions::FlattenOperation

Public Instance Methods

<<(operand) click to toggle source

Add an operand to the operation, flattening the same types

Flattening means that if the operand is the same as the operation, we should just include the operand's operands in the operation and prune that part of the tree. This results in a shallower tree, is faster to match and usually generates more efficient queries in the adapters.

@param [AbstractOperation, AbstractComparison, Array] operand

the operand to add

@return [self]

the operation

@api semipublic

# File lib/dm-core/query/conditions/operation.rb, line 431
def <<(operand)
  if kind_of?(operand.class)
    merge(operand.operands)
  else
    super
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.