diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 16:20:03 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 16:20:03 -0800 |
commit | 3a2133d54f903d997b68930c0c6adc58716a253c (patch) | |
tree | 354b93dbcc4b647f9b181ded1c1a295ac2ed6611 /lib/arel | |
parent | d7ff05e240770c1946fe4c0c1f74880ecd180b09 (diff) | |
parent | f5e09790550fcb7d413d495be25f8fe74a571850 (diff) | |
download | rails-3a2133d54f903d997b68930c0c6adc58716a253c.tar.gz rails-3a2133d54f903d997b68930c0c6adc58716a253c.tar.bz2 rails-3a2133d54f903d997b68930c0c6adc58716a253c.zip |
Merge branch '2-0-stable'
* 2-0-stable:
adding better tests surrounding limits in adapter visitors
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/visitors/mysql.rb | 2 | ||||
-rw-r--r-- | lib/arel/visitors/postgresql.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/arel/visitors/mysql.rb b/lib/arel/visitors/mysql.rb index b37d76f710..e90161eee4 100644 --- a/lib/arel/visitors/mysql.rb +++ b/lib/arel/visitors/mysql.rb @@ -25,7 +25,7 @@ module Arel ("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?), ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?), - ("LIMIT #{visit o.limit}" if o.limit), + (visit(o.limit) if o.limit), ].compact.join ' ' end diff --git a/lib/arel/visitors/postgresql.rb b/lib/arel/visitors/postgresql.rb index 01fbda75b9..0e82a703ca 100644 --- a/lib/arel/visitors/postgresql.rb +++ b/lib/arel/visitors/postgresql.rb @@ -17,7 +17,7 @@ module Arel [ "SELECT * FROM (#{sql}) AS id_list", "ORDER BY #{aliased_orders(o.orders).join(', ')}", - ("LIMIT #{visit o.limit}" if o.limit), + (visit(o.limit) if o.limit), (visit(o.offset) if o.offset), ].compact.join ' ' else |