diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 12:20:13 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 12:20:13 -0800 |
commit | 90be95a0aba12787882d9821d9a4d5f00781beb6 (patch) | |
tree | a0570cc0308ef994c0ced09d51c32b3bfdadf1c1 | |
parent | 957f4c02ddccd243b965e60351bc0a0083e4887d (diff) | |
download | rails-90be95a0aba12787882d9821d9a4d5f00781beb6.tar.gz rails-90be95a0aba12787882d9821d9a4d5f00781beb6.tar.bz2 rails-90be95a0aba12787882d9821d9a4d5f00781beb6.zip |
fisting lots of oracle errors
-rw-r--r-- | lib/arel/visitors/oracle.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/arel/visitors/oracle.rb b/lib/arel/visitors/oracle.rb index 63dfc6788c..5808d7a511 100644 --- a/lib/arel/visitors/oracle.rb +++ b/lib/arel/visitors/oracle.rb @@ -10,7 +10,7 @@ module Arel # then can use simple ROWNUM in WHERE clause if o.limit && o.orders.empty? && !o.offset && o.cores.first.projections.first !~ /^DISTINCT / o.cores.last.wheres.push Nodes::LessThanOrEqual.new( - Nodes::SqlLiteral.new('ROWNUM'), o.limit + Nodes::SqlLiteral.new('ROWNUM'), o.limit.expr ) o.limit = nil return super @@ -18,7 +18,7 @@ module Arel if o.limit && o.offset o = o.dup - limit = o.limit.to_i + limit = o.limit.expr.to_i offset = o.offset o.limit = nil o.offset = nil @@ -35,9 +35,9 @@ module Arel if o.limit o = o.dup - limit = o.limit + limit = o.limit.expr o.limit = nil - return "SELECT * FROM (#{super(o)}) WHERE ROWNUM <= #{limit}" + return "SELECT * FROM (#{super(o)}) WHERE ROWNUM <= #{visit limit}" end if o.offset |