diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2017-07-21 09:11:47 -0400 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2017-07-21 09:17:50 -0400 |
commit | 53521a9e39b9d8af4165d7703c36dc905f1f8f67 (patch) | |
tree | 9b699ba34cd5a782a0e87c9a8fa885e56b597551 /lib/arel/visitors/oracle.rb | |
parent | db1bb4e9a728a437d16f8bdb48c3b772c3e4edb0 (diff) | |
download | rails-53521a9e39b9d8af4165d7703c36dc905f1f8f67.tar.gz rails-53521a9e39b9d8af4165d7703c36dc905f1f8f67.tar.bz2 rails-53521a9e39b9d8af4165d7703c36dc905f1f8f67.zip |
Refactor `substitute_binds` to perform substitution immediately
I'm honestly not sure if replacing bind params with their concrete
values is something that belongs in Arel at all, as it's something that
will need to be coupled to the quoting mechanism of the caller, and
could just be accomplished by using `Quoted` instead.
Still, with the new structure we can provide a much simpler API around
substitution. The expectation of the quoter responding to `quote` is a
reasonably minimal API.
I originally used `DelegateClass` here, with the one line override of
`add_bind`, but realized that we have some funky code going on where the
collector returns the next collector to use (in practice `self` is
always returned, and I don't see why we'd ever want to do this).
Removing that would likely be worthwhile, but would be a larger
refactoring
Diffstat (limited to 'lib/arel/visitors/oracle.rb')
-rw-r--r-- | lib/arel/visitors/oracle.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/arel/visitors/oracle.rb b/lib/arel/visitors/oracle.rb index 3b452836db..c1e41be66f 100644 --- a/lib/arel/visitors/oracle.rb +++ b/lib/arel/visitors/oracle.rb @@ -145,7 +145,7 @@ module Arel end def visit_Arel_Nodes_BindParam o, collector - collector.add_bind(o) { |i| ":a#{i}" } + collector.add_bind(o.value) { |i| ":a#{i}" } end end |