diff options
Diffstat (limited to 'lib/arel/visitors')
-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 c1e41be66f..95c37eba6b 100644 --- a/lib/arel/visitors/oracle.rb +++ b/lib/arel/visitors/oracle.rb @@ -31,10 +31,11 @@ module Arel if offset.expr.is_a? Nodes::BindParam offset_bind = nil collector << ') raw_sql_ WHERE rownum <= (' - collector.add_bind(offset.expr) { |i| offset_bind = ":a#{i}" } + collector = visit offset.expr, collector collector << ' + ' - collector.add_bind(limit) { |i| ":a#{i}" } - collector << ") ) WHERE raw_rnum_ > #{offset_bind}" + collector = visit limit, collector + collector << ") ) WHERE raw_rnum_ > " + collector = visit offset.expr, collector return collector else collector << ") raw_sql_ |