diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-03-20 11:47:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-20 11:47:24 -0400 |
commit | d4c3db0d27e68e6c2c43b7aaa4e7c49cb98bab27 (patch) | |
tree | 5d7dd723fd7d17edbc035e806efb4dea0cfabc5e /activerecord/lib | |
parent | 1835d87fb848fd9f13e43bf16abd41be231b1666 (diff) | |
parent | 082c75f6232e811287d36441711f75bdcabb51d4 (diff) | |
download | rails-d4c3db0d27e68e6c2c43b7aaa4e7c49cb98bab27.tar.gz rails-d4c3db0d27e68e6c2c43b7aaa4e7c49cb98bab27.tar.bz2 rails-d4c3db0d27e68e6c2c43b7aaa4e7c49cb98bab27.zip |
Merge pull request #27939 from kamipo/fix_select_all_with_legacy_binds
Fix `select_all` with legacy `binds`
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/quoting.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb index e5a24b2aca..6019e05c4c 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb @@ -155,7 +155,11 @@ module ActiveRecord private def type_casted_binds(binds) - binds.map { |attr| type_cast(attr.value_for_database) } + if binds.first.is_a?(Array) + binds.map { |column, value| type_cast(value, column) } + else + binds.map { |attr| type_cast(attr.value_for_database) } + end end def id_value_for_database(value) |