Class: Arel::Predicates::CompoundPredicate
- Inherits:
-
Binary
show all
- Defined in:
- lib/arel/algebra/predicates.rb,
lib/arel/engines/sql/predicates.rb,
lib/arel/engines/memory/predicates.rb
Direct Known Subclasses
And, Or
Instance Method Summary
collapse
Methods inherited from Binary
#==, #bind
Methods inherited from Predicate
#and, #complement, #not, #or
Instance Method Details
#eval(row) ⇒ Object
38
39
40
|
# File 'lib/arel/engines/memory/predicates.rb', line 38
def eval(row)
eval "operand1.eval(row) #{operator} operand2.eval(row)"
end
|
#to_sql(formatter = nil) ⇒ Object
20
21
22
|
# File 'lib/arel/engines/sql/predicates.rb', line 20
def to_sql(formatter = nil)
"(#{operand1.to_sql(formatter)} #{predicate_sql} #{operand2.to_sql(formatter)})"
end
|