From 9dbd97e8e2361de2769c2bc5737b64cdf27025ea Mon Sep 17 00:00:00 2001 From: zhufenggood Date: Fri, 27 Jan 2017 18:43:34 +0800 Subject: Performance improvement. --- lib/arel/visitors/to_sql.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index ce9f8bca59..486c51a183 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -80,7 +80,7 @@ module Arel collector << 'DELETE FROM ' collector = visit o.relation, collector if o.wheres.any? - collector << ' WHERE ' + collector << WHERE collector = inject_join o.wheres, collector, AND end @@ -265,12 +265,12 @@ module Arel def visit_Arel_Nodes_With o, collector collector << "WITH " - inject_join o.children, collector, ', ' + inject_join o.children, collector, COMMA end def visit_Arel_Nodes_WithRecursive o, collector collector << "WITH RECURSIVE " - inject_join o.children, collector, ', ' + inject_join o.children, collector, COMMA end def visit_Arel_Nodes_Union o, collector @@ -524,7 +524,7 @@ module Arel end if o.right.any? collector << SPACE if o.left - collector = inject_join o.right, collector, ' ' + collector = inject_join o.right, collector, SPACE end collector end -- cgit v1.2.3