diff options
Diffstat (limited to 'lib/arel/engines')
-rw-r--r-- | lib/arel/engines/memory/predicates.rb | 2 | ||||
-rw-r--r-- | lib/arel/engines/sql/engine.rb | 3 | ||||
-rw-r--r-- | lib/arel/engines/sql/predicates.rb | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/lib/arel/engines/memory/predicates.rb b/lib/arel/engines/memory/predicates.rb index e36afa38c2..1527b04056 100644 --- a/lib/arel/engines/memory/predicates.rb +++ b/lib/arel/engines/memory/predicates.rb @@ -1,6 +1,6 @@ module Arel module Predicates - class Binary < Predicate + class Binary < Unary def eval(row) operand1.eval(row).send(operator, operand2.eval(row)) end diff --git a/lib/arel/engines/sql/engine.rb b/lib/arel/engines/sql/engine.rb index 07940c6ef1..a314a972c0 100644 --- a/lib/arel/engines/sql/engine.rb +++ b/lib/arel/engines/sql/engine.rb @@ -4,11 +4,10 @@ module Arel def initialize(ar = nil) @ar = ar - @connection = nil end def connection - @connection ||= @ar && @ar.connection + @ar ? @ar.connection : nil end def adapter_name diff --git a/lib/arel/engines/sql/predicates.rb b/lib/arel/engines/sql/predicates.rb index 21d8f840c9..74a36d77c9 100644 --- a/lib/arel/engines/sql/predicates.rb +++ b/lib/arel/engines/sql/predicates.rb @@ -1,6 +1,6 @@ module Arel module Predicates - class Binary < Predicate + class Binary < Unary def to_sql(formatter = nil) "#{operand1.to_sql} #{predicate_sql} #{operand1.format(operand2)}" end |