diff options
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r-- | lib/arel/visitors/where_sql.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/arel/visitors/where_sql.rb b/lib/arel/visitors/where_sql.rb index 80797205c9..41972d5836 100644 --- a/lib/arel/visitors/where_sql.rb +++ b/lib/arel/visitors/where_sql.rb @@ -1,12 +1,17 @@ module Arel module Visitors class WhereSql < Arel::Visitors::ToSql + def initialize(inner_visitor, *args, &block) + @inner_visitor = inner_visitor + super(*args, &block) + end + private def visit_Arel_Nodes_SelectCore o, collector collector << "WHERE " wheres = o.wheres.map do |where| - Nodes::SqlLiteral.new(@connection.visitor.accept(where, collector.class.new).value) + Nodes::SqlLiteral.new(@inner_visitor.accept(where, collector.class.new).value) end inject_join wheres, collector, ' AND ' |