From aa6a82617178698f4f5083cc8ba08d2f761583af Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 24 Sep 2010 13:56:37 -0700 Subject: avoid modifying the ast in certain cases --- lib/arel/visitors/oracle.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/arel') 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 -- cgit v1.2.3