diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-06 20:26:08 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-06 20:26:08 -0800 |
commit | 4018b5d66a810a34273d4b198688896f6f7459f3 (patch) | |
tree | 70b54b9f1195589bcf6434e24322d6f64fbb5d90 /lib/arel | |
parent | c28fe4cbbb1121394c6bb14403350723f9ecce4c (diff) | |
download | rails-4018b5d66a810a34273d4b198688896f6f7459f3.tar.gz rails-4018b5d66a810a34273d4b198688896f6f7459f3.tar.bz2 rails-4018b5d66a810a34273d4b198688896f6f7459f3.zip |
quoting limit nodes
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/visitors/mysql.rb | 2 | ||||
-rw-r--r-- | lib/arel/visitors/postgresql.rb | 2 | ||||
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/arel/visitors/mysql.rb b/lib/arel/visitors/mysql.rb index 143b4d36f4..ace8fb0979 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 #{o.limit}" if o.limit), + ("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 553ee91bf9..01fbda75b9 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 #{o.limit}" if o.limit), + ("LIMIT #{visit o.limit}" if o.limit), (visit(o.offset) if o.offset), ].compact.join ' ' else diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 2713621a54..2fb464b265 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -76,7 +76,7 @@ module Arel [ o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join, ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?), - ("LIMIT #{o.limit}" if o.limit), + ("LIMIT #{visit o.limit}" if o.limit), (visit(o.offset) if o.offset), (visit(o.lock) if o.lock), ].compact.join ' ' |