diff options
author | zhufenggood <zhufenggood@gmail.com> | 2016-04-15 06:17:50 +0800 |
---|---|---|
committer | zhufenggood <zhufenggood@gmail.com> | 2016-04-15 06:17:50 +0800 |
commit | 45af55c0fc387bc07f3ae3bed987035a589ccb10 (patch) | |
tree | 919b75a26457f299c3bcaf66074e246091e58171 /lib/arel | |
parent | 1659fdc2998bb84847b091f32dd9346440532d49 (diff) | |
download | rails-45af55c0fc387bc07f3ae3bed987035a589ccb10.tar.gz rails-45af55c0fc387bc07f3ae3bed987035a589ccb10.tar.bz2 rails-45af55c0fc387bc07f3ae3bed987035a589ccb10.zip |
Update to_sql.rb
Update to_sql.rb. Slightly performance improvement.
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index cab0ab7eca..f2a3d5aa0c 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -349,13 +349,13 @@ module Arel end if o.orders.any? - collector << ' ' if o.partitions.any? + collector << SPACE if o.partitions.any? collector << "ORDER BY " collector = inject_join o.orders, collector, ", " end if o.framing - collector << ' ' if o.partitions.any? or o.orders.any? + collector << SPACE if o.partitions.any? or o.orders.any? collector = visit o.framing, collector end @@ -564,7 +564,7 @@ module Arel collector = visit o.left, collector end if o.right.any? - collector << " " if o.left + collector << SPACE if o.left collector = inject_join o.right, collector, ' ' end collector |