Skip to content

Commit

Permalink
Merge pull request #93 from norman/fix-for-where-true
Browse files Browse the repository at this point in the history
Ensure @last_column is cleared after visiting object
  • Loading branch information
tenderlove committed Jan 9, 2012
2 parents d9c27c1 + c9bf52b commit 529013d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/arel/visitors/to_sql.rb
Expand Up @@ -133,7 +133,7 @@ def visit_Arel_Nodes_SelectCore o
(visit(o.set_quantifier) if o.set_quantifier), (visit(o.set_quantifier) if o.set_quantifier),
("#{o.projections.map { |x| visit x }.join ', '}" unless o.projections.empty?), ("#{o.projections.map { |x| visit x }.join ', '}" unless o.projections.empty?),
("FROM #{visit(o.source)}" if o.source && !o.source.empty?), ("FROM #{visit(o.source)}" if o.source && !o.source.empty?),
("WHERE #{o.wheres.map { |x| visit x }.join ' AND ' }" unless o.wheres.empty?), ("WHERE #{o.wheres.map { |x| accept x }.join ' AND ' }" unless o.wheres.empty?),
("GROUP BY #{o.groups.map { |x| visit x }.join ', ' }" unless o.groups.empty?), ("GROUP BY #{o.groups.map { |x| visit x }.join ', ' }" unless o.groups.empty?),
(visit(o.having) if o.having), (visit(o.having) if o.having),
].compact.join ' ' ].compact.join ' '
Expand Down

0 comments on commit 529013d

Please sign in to comment.