diff options
author | Bryan Helmkamp <bryan@brynary.com> | 2009-05-17 16:31:16 -0400 |
---|---|---|
committer | Bryan Helmkamp <bryan@brynary.com> | 2009-05-17 16:31:16 -0400 |
commit | 0352d28a56de36946e691a0df390cfdfa7b1de7c (patch) | |
tree | 9a8868bd804d5b6d79378729583f6a81d7c0e6d5 | |
parent | dc7b51883b1cc8ad7e525b7315fb575ae77a5b3d (diff) | |
download | rails-0352d28a56de36946e691a0df390cfdfa7b1de7c.tar.gz rails-0352d28a56de36946e691a0df390cfdfa7b1de7c.tar.bz2 rails-0352d28a56de36946e691a0df390cfdfa7b1de7c.zip |
Moving a few stray SQL references in the memory engine code
-rw-r--r-- | lib/arel/engines/memory/predicates.rb | 15 | ||||
-rw-r--r-- | lib/arel/engines/sql/predicates.rb | 14 |
2 files changed, 14 insertions, 15 deletions
diff --git a/lib/arel/engines/memory/predicates.rb b/lib/arel/engines/memory/predicates.rb index e233f3ba39..03d4f25b0a 100644 --- a/lib/arel/engines/memory/predicates.rb +++ b/lib/arel/engines/memory/predicates.rb @@ -1,25 +1,10 @@ module Arel - class Binary < Predicate def eval(row) operand1.eval(row).send(operator, operand2.eval(row)) end end - class CompoundPredicate < Binary - def to_sql(formatter = nil) - "(#{operand1.to_sql(formatter)} #{predicate_sql} #{operand2.to_sql(formatter)})" - end - end - - class Or < CompoundPredicate - def predicate_sql; "OR" end - end - - class And < CompoundPredicate - def predicate_sql; "AND" end - end - class Equality < Binary def operator; :== end end diff --git a/lib/arel/engines/sql/predicates.rb b/lib/arel/engines/sql/predicates.rb index 7e195c2605..b84c183c1d 100644 --- a/lib/arel/engines/sql/predicates.rb +++ b/lib/arel/engines/sql/predicates.rb @@ -5,6 +5,20 @@ module Arel end end + class CompoundPredicate < Binary + def to_sql(formatter = nil) + "(#{operand1.to_sql(formatter)} #{predicate_sql} #{operand2.to_sql(formatter)})" + end + end + + class Or < CompoundPredicate + def predicate_sql; "OR" end + end + + class And < CompoundPredicate + def predicate_sql; "AND" end + end + class Equality < Binary def predicate_sql operand2.equality_predicate_sql |