diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 14:29:38 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 14:29:38 -0800 |
commit | fd24494797461d487bacc277b4ff32392c64906d (patch) | |
tree | 4c9e77fb15cdb7d7ab3f6125e22872180d1292c1 /lib/arel | |
parent | b035def39a8b4966fd33779bd5a2a9d0c9a33e66 (diff) | |
download | rails-fd24494797461d487bacc277b4ff32392c64906d.tar.gz rails-fd24494797461d487bacc277b4ff32392c64906d.tar.bz2 rails-fd24494797461d487bacc277b4ff32392c64906d.zip |
we do not need to modify the AST
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/visitors/oracle.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/arel/visitors/oracle.rb b/lib/arel/visitors/oracle.rb index fa943b2904..87b8f10ef4 100644 --- a/lib/arel/visitors/oracle.rb +++ b/lib/arel/visitors/oracle.rb @@ -12,7 +12,6 @@ module Arel o.cores.last.wheres.push Nodes::LessThanOrEqual.new( Nodes::SqlLiteral.new('ROWNUM'), o.limit.expr ) - o.limit = nil return super end @@ -20,7 +19,6 @@ module Arel o = o.dup limit = o.limit.expr.to_i offset = o.offset - o.limit = nil o.offset = nil sql = super(o) return <<-eosql @@ -36,7 +34,6 @@ module Arel if o.limit o = o.dup limit = o.limit.expr - o.limit = nil return "SELECT * FROM (#{super(o)}) WHERE ROWNUM <= #{visit limit}" end @@ -57,6 +54,10 @@ module Arel super end + def visit_Arel_Nodes_Limit o + '' + end + def visit_Arel_Nodes_Offset o "raw_rnum_ > #{visit o.value}" end |