From 0352d28a56de36946e691a0df390cfdfa7b1de7c Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sun, 17 May 2009 16:31:16 -0400 Subject: Moving a few stray SQL references in the memory engine code --- lib/arel/engines/memory/predicates.rb | 15 --------------- 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 -- cgit v1.2.3