From 621775361c2535b819ca1f3416170d4bb2deadd5 Mon Sep 17 00:00:00 2001 From: claudiob Date: Thu, 23 Oct 2014 17:35:43 -0700 Subject: Completes 08e6491 in reusing `maybe_visit` :sweat: I don't know why the tests did not fail, but to keep the same syntax as before, `collector =` is required. Maybe `visit` changes `collector` in-place, so the result is the same, but since I'm not sure about the side effects, I think this PR is needed to. Sorry! :sweat: --- lib/arel/visitors/to_sql.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index bccf1d4061..a3f8cb565d 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -229,9 +229,9 @@ module Arel def visit_Arel_Nodes_SelectCore o, collector collector << "SELECT" - maybe_visit o.top, collector + collector = maybe_visit o.top, collector - maybe_visit o.set_quantifier, collector + collector = maybe_visit o.set_quantifier, collector unless o.projections.empty? collector << SPACE @@ -265,7 +265,7 @@ module Arel end end - maybe_visit o.having, collector + collector = maybe_visit o.having, collector unless o.windows.empty? collector << WINDOW -- cgit v1.2.3