diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-10-15 11:28:44 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-10-15 11:28:44 -0700 |
commit | 890eaf4784fb6b4ee9e1a8f167f6a9b28525722e (patch) | |
tree | f8936925ea783a178170e4a397ce569f988de023 /lib | |
parent | 9367992b4cc274766d3dd099330bbe610c8038f4 (diff) | |
download | rails-890eaf4784fb6b4ee9e1a8f167f6a9b28525722e.tar.gz rails-890eaf4784fb6b4ee9e1a8f167f6a9b28525722e.tar.bz2 rails-890eaf4784fb6b4ee9e1a8f167f6a9b28525722e.zip |
avoid extra string objects in the inner join case
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 76355a00df..c4c2e6fe0f 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -455,7 +455,12 @@ key on UpdateManager using UpdateManager#key= end def visit_Arel_Nodes_InnerJoin o - "INNER JOIN #{visit o.left} #{visit o.right if o.right}" + s = "INNER JOIN #{visit o.left}" + if o.right + s << SPACE + s << visit(o.right) + end + s end def visit_Arel_Nodes_On o |