diff options
Diffstat (limited to 'lib/arel/engines/sql/predicates.rb')
-rw-r--r-- | lib/arel/engines/sql/predicates.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/arel/engines/sql/predicates.rb b/lib/arel/engines/sql/predicates.rb index 59b0ab0929..93d2a2f619 100644 --- a/lib/arel/engines/sql/predicates.rb +++ b/lib/arel/engines/sql/predicates.rb @@ -5,13 +5,13 @@ module Arel "#{operand1.to_sql} #{predicate_sql} #{operand1.format(operand2)}" end end - + class Unary < Predicate def to_sql(formatter = nil) "#{predicate_sql} (#{operand.to_sql(formatter)})" end end - + class Not < Unary def predicate_sql; "NOT" end end @@ -29,19 +29,19 @@ module Arel class And < CompoundPredicate def predicate_sql; "AND" end end - + class Polyadic < Predicate def to_sql(formatter = nil) - "(" + + "(" + predicates.map {|p| p.to_sql(formatter)}.join(" #{predicate_sql} ") + ")" end end - + class Any < Polyadic def predicate_sql; "OR" end end - + class All < Polyadic def predicate_sql; "AND" end end @@ -77,7 +77,7 @@ module Arel class Match < Binary def predicate_sql; 'LIKE' end end - + class NotMatch < Binary def predicate_sql; 'NOT LIKE' end end @@ -92,10 +92,10 @@ module Arel super end end - + def predicate_sql; operand2.inclusion_predicate_sql end end - + class NotIn < Binary def predicate_sql; operand2.exclusion_predicate_sql end end |