aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBryan Helmkamp <bryan@brynary.com>2009-05-17 16:31:16 -0400
committerBryan Helmkamp <bryan@brynary.com>2009-05-17 16:31:16 -0400
commit0352d28a56de36946e691a0df390cfdfa7b1de7c (patch)
tree9a8868bd804d5b6d79378729583f6a81d7c0e6d5 /lib
parentdc7b51883b1cc8ad7e525b7315fb575ae77a5b3d (diff)
downloadrails-0352d28a56de36946e691a0df390cfdfa7b1de7c.tar.gz
rails-0352d28a56de36946e691a0df390cfdfa7b1de7c.tar.bz2
rails-0352d28a56de36946e691a0df390cfdfa7b1de7c.zip
Moving a few stray SQL references in the memory engine code
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/engines/memory/predicates.rb15
-rw-r--r--lib/arel/engines/sql/predicates.rb14
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