aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/oracle.rb
diff options
context:
space:
mode:
authorYasuo Honda <yasuo.honda@gmail.com>2017-07-25 19:00:12 +0000
committerYasuo Honda <yasuo.honda@gmail.com>2017-07-25 19:46:43 +0000
commitf25ee14a470d7505098fd3fdae04ddcffe70f2e2 (patch)
tree104cb56c7aa6bb40865f05df2bf6ca2d145b6ea3 /lib/arel/visitors/oracle.rb
parentf4227bf20a16a1d688afc24cf0038e2f98905dd4 (diff)
downloadrails-f25ee14a470d7505098fd3fdae04ddcffe70f2e2.tar.gz
rails-f25ee14a470d7505098fd3fdae04ddcffe70f2e2.tar.bz2
rails-f25ee14a470d7505098fd3fdae04ddcffe70f2e2.zip
Address `undefined method `value_for_database'` in Oracle visitor
Here `offset` is bound twice. It used to be `:b1` appeared twice. This commit changes the second `offset` name changed from `:b1` to `:b3` which should not affect the actual bind values for offset.
Diffstat (limited to 'lib/arel/visitors/oracle.rb')
-rw-r--r--lib/arel/visitors/oracle.rb7
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_