aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-24 13:56:37 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-24 13:56:37 -0700
commitaa6a82617178698f4f5083cc8ba08d2f761583af (patch)
tree88794af81a74f9d61cb87814f0c895bf4cc6ded2 /lib/arel
parentd94122485a8f89f13293438142fa292640600c54 (diff)
downloadrails-aa6a82617178698f4f5083cc8ba08d2f761583af.tar.gz
rails-aa6a82617178698f4f5083cc8ba08d2f761583af.tar.bz2
rails-aa6a82617178698f4f5083cc8ba08d2f761583af.zip
avoid modifying the ast in certain cases
Diffstat (limited to 'lib/arel')
-rw-r--r--lib/arel/visitors/oracle.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/arel/visitors/oracle.rb b/lib/arel/visitors/oracle.rb
index 46a3ad4c78..360715f307 100644
--- a/lib/arel/visitors/oracle.rb
+++ b/lib/arel/visitors/oracle.rb
@@ -15,11 +15,12 @@ module Arel
end
if o.limit && o.offset
+ o = o.dup
limit = o.limit.to_i
offset = o.offset
o.limit = nil
o.offset = nil
- sql = super
+ sql = super(o)
return <<-eosql
SELECT * FROM (
SELECT raw_sql_.*, rownum raw_rnum_
@@ -31,9 +32,10 @@ module Arel
end
if o.limit && !o.orders.empty?
+ o = o.dup
limit = o.limit
o.limit = nil
- return "SELECT * FROM (#{super}) WHERE ROWNUM <= #{limit}"
+ return "SELECT * FROM (#{super(o)}) WHERE ROWNUM <= #{limit}"
end
super