aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-03 12:20:13 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-03 13:24:36 -0800
commit4acbe3864f5e5c4c8c70c5f58fbd5c09617d1662 (patch)
tree387a0f3ab9d9fd17a6e3c81dcc6d96b4cdcbc940
parent1215c28311aab325c55c083d15cbf3e16599d502 (diff)
downloadrails-4acbe3864f5e5c4c8c70c5f58fbd5c09617d1662.tar.gz
rails-4acbe3864f5e5c4c8c70c5f58fbd5c09617d1662.tar.bz2
rails-4acbe3864f5e5c4c8c70c5f58fbd5c09617d1662.zip
fisting lots of oracle errors
-rw-r--r--lib/arel/visitors/oracle.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/arel/visitors/oracle.rb b/lib/arel/visitors/oracle.rb
index ecb157f8bc..fa943b2904 100644
--- a/lib/arel/visitors/oracle.rb
+++ b/lib/arel/visitors/oracle.rb
@@ -10,7 +10,7 @@ module Arel
# then can use simple ROWNUM in WHERE clause
if o.limit && o.orders.empty? && !o.offset && o.cores.first.projections.first !~ /^DISTINCT /
o.cores.last.wheres.push Nodes::LessThanOrEqual.new(
- Nodes::SqlLiteral.new('ROWNUM'), o.limit
+ Nodes::SqlLiteral.new('ROWNUM'), o.limit.expr
)
o.limit = nil
return super
@@ -18,7 +18,7 @@ module Arel
if o.limit && o.offset
o = o.dup
- limit = o.limit.to_i
+ limit = o.limit.expr.to_i
offset = o.offset
o.limit = nil
o.offset = nil
@@ -35,9 +35,9 @@ module Arel
if o.limit
o = o.dup
- limit = o.limit
+ limit = o.limit.expr
o.limit = nil
- return "SELECT * FROM (#{super(o)}) WHERE ROWNUM <= #{limit}"
+ return "SELECT * FROM (#{super(o)}) WHERE ROWNUM <= #{visit limit}"
end
if o.offset