diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-11 16:14:04 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-11 16:17:42 -0700 |
commit | d1192956e481474a77ea01da35c0546ff422a0e6 (patch) | |
tree | 97cf8b3acfc9f39e83b8027ef024e5afbb888129 /lib/arel/visitors/mysql.rb | |
parent | 048478bf152a495a2d0ba17990d6966970a38cff (diff) | |
download | rails-d1192956e481474a77ea01da35c0546ff422a0e6.tar.gz rails-d1192956e481474a77ea01da35c0546ff422a0e6.tar.bz2 rails-d1192956e481474a77ea01da35c0546ff422a0e6.zip |
always add a space before keywords (it is easier)
Diffstat (limited to 'lib/arel/visitors/mysql.rb')
-rw-r--r-- | lib/arel/visitors/mysql.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/arel/visitors/mysql.rb b/lib/arel/visitors/mysql.rb index c4800f0466..70a37582c2 100644 --- a/lib/arel/visitors/mysql.rb +++ b/lib/arel/visitors/mysql.rb @@ -54,24 +54,18 @@ module Arel collector << "UPDATE " collector = visit o.relation, collector - add_space = false - unless o.values.empty? - add_space = true - collector << "SET " + collector << " SET " collector = inject_join o.values, collector, ', ' end unless o.wheres.empty? - collector << ' ' if add_space - add_space = true - collector << "WHERE " + collector << " WHERE " collector = inject_join o.wheres, collector, ' AND ' end unless o.orders.empty? - collector << ' ' if add_space - collector << "ORDER BY " + collector << " ORDER BY " collector = inject_join o.orders, collector, ', ' end |