aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-04-14 15:35:27 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2016-04-14 15:35:27 -0700
commitf2ad22320d82021277ab835d4d44bef5e8b61866 (patch)
tree919b75a26457f299c3bcaf66074e246091e58171
parent1659fdc2998bb84847b091f32dd9346440532d49 (diff)
parent45af55c0fc387bc07f3ae3bed987035a589ccb10 (diff)
downloadrails-f2ad22320d82021277ab835d4d44bef5e8b61866.tar.gz
rails-f2ad22320d82021277ab835d4d44bef5e8b61866.tar.bz2
rails-f2ad22320d82021277ab835d4d44bef5e8b61866.zip
Merge pull request #429 from zhufenggood/master
Update to_sql.rb. More slightly performance improvement.
-rw-r--r--lib/arel/visitors/to_sql.rb6
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