diff options
Diffstat (limited to 'lib/arel/visitors/where_sql.rb')
-rw-r--r-- | lib/arel/visitors/where_sql.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/arel/visitors/where_sql.rb b/lib/arel/visitors/where_sql.rb index 9816fa7a70..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 |