diff options
Diffstat (limited to 'lib/arel/visitors/oracle.rb')
-rw-r--r-- | lib/arel/visitors/oracle.rb | 6 |
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 |