diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 14:29:43 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 14:29:43 -0800 |
commit | 597fe1580902f9ae661992448c966bc6372d5ba0 (patch) | |
tree | 9a0b25a8166b1d1cd9efa28a8caae34c715cfedb /lib/arel/visitors/oracle.rb | |
parent | a846eef9110c39e5d0f48df9a4a6948545f6cfe5 (diff) | |
parent | fd24494797461d487bacc277b4ff32392c64906d (diff) | |
download | rails-597fe1580902f9ae661992448c966bc6372d5ba0.tar.gz rails-597fe1580902f9ae661992448c966bc6372d5ba0.tar.bz2 rails-597fe1580902f9ae661992448c966bc6372d5ba0.zip |
Merge branch '2-0-stable'
* 2-0-stable:
we do not need to modify the AST
Diffstat (limited to 'lib/arel/visitors/oracle.rb')
-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 5808d7a511..7d62531afb 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.expr}" end |