aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/where_sql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/visitors/where_sql.rb')
-rw-r--r--lib/arel/visitors/where_sql.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/arel/visitors/where_sql.rb b/lib/arel/visitors/where_sql.rb
index acd84cd631..27dde73673 100644
--- a/lib/arel/visitors/where_sql.rb
+++ b/lib/arel/visitors/where_sql.rb
@@ -1,8 +1,9 @@
module Arel
module Visitors
class WhereSql < Arel::Visitors::ToSql
- def visit_Arel_Nodes_SelectCore o
- "WHERE #{o.wheres.map { |x| visit x}.join ' AND ' }"
+ def visit_Arel_Nodes_SelectCore o, collector
+ collector << "WHERE "
+ inject_join o.wheres, collector, ' AND '
end
end
end