aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/statement_cache.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-07-24 13:05:05 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-07-28 14:28:44 +0900
commit5465508abe9ab49ccc01d2a9b43c5cfc2a70aea5 (patch)
treefb4e3c01e361decabafba23ca546425aa04e1a5a /activerecord/lib/active_record/statement_cache.rb
parent4211a29902eac95e67e9fed2b9dfce7a1f1d2799 (diff)
downloadrails-5465508abe9ab49ccc01d2a9b43c5cfc2a70aea5.tar.gz
rails-5465508abe9ab49ccc01d2a9b43c5cfc2a70aea5.tar.bz2
rails-5465508abe9ab49ccc01d2a9b43c5cfc2a70aea5.zip
Remove `prepare_binds_for_database` internal method
To avoid relying on the connection adapter for type casting binds.
Diffstat (limited to 'activerecord/lib/active_record/statement_cache.rb')
-rw-r--r--activerecord/lib/active_record/statement_cache.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/statement_cache.rb b/activerecord/lib/active_record/statement_cache.rb
index 5607be6d12..8a29547bda 100644
--- a/activerecord/lib/active_record/statement_cache.rb
+++ b/activerecord/lib/active_record/statement_cache.rb
@@ -49,8 +49,8 @@ module ActiveRecord
def sql_for(binds, connection)
val = @values.dup
- binds = connection.prepare_binds_for_database(binds)
- @indexes.each { |i| val[i] = connection.quote(binds.shift) }
+ casted_binds = binds.map(&:value_for_database)
+ @indexes.each { |i| val[i] = connection.quote(casted_binds.shift) }
val.join
end
end