diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-21 09:20:14 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-21 09:20:14 -0700 |
commit | 2b20a488519716be15fbe351f7da39c9fd70f846 (patch) | |
tree | 00f61fcd6fa5590f1cb94d430c1d5f6322de0e7f /lib/arel/visitors/to_sql.rb | |
parent | 0e98ef149cd44dc04d40a8553e1743c5cb6d4a7c (diff) | |
download | rails-2b20a488519716be15fbe351f7da39c9fd70f846.tar.gz rails-2b20a488519716be15fbe351f7da39c9fd70f846.tar.bz2 rails-2b20a488519716be15fbe351f7da39c9fd70f846.zip |
making stuff work on mysql
Diffstat (limited to 'lib/arel/visitors/to_sql.rb')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index d6a9a3697f..710b6143ec 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -25,7 +25,9 @@ module Arel [ "UPDATE #{visit o.relation}", ("SET #{o.values.map { |value| visit value }.join ', '}" unless o.values.empty?), - ("WHERE #{o.wheres.map { |x| visit x }.join ' AND '}" unless o.wheres.empty?) + ("WHERE #{o.wheres.map { |x| visit x }.join ' AND '}" unless o.wheres.empty?), + ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?), + ("LIMIT #{o.limit}" if o.limit), ].compact.join ' ' end |