diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-05-20 23:23:37 -0300 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-05-20 23:23:37 -0300 |
commit | d4a1b33a2ab6703124926fbf805d77ef753e1b87 (patch) | |
tree | ce561b849c2237f7cfadf5f343cd7978c5c4acff /activerecord/lib/active_record/associations | |
parent | f85bbed4cdc1bdfd1e0dbd97bce9db81e44cbd11 (diff) | |
parent | 82bb0084b4c0de231a374ce9ca7c70391e9aa6e6 (diff) | |
download | rails-d4a1b33a2ab6703124926fbf805d77ef753e1b87.tar.gz rails-d4a1b33a2ab6703124926fbf805d77ef753e1b87.tar.bz2 rails-d4a1b33a2ab6703124926fbf805d77ef753e1b87.zip |
Merge pull request #25043 from tlrdstd/support_ruby_2_3
Associations do not call `.to_proc` on Hash
Diffstat (limited to 'activerecord/lib/active_record/associations')
3 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index 99f307922e..abee941c07 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -158,7 +158,7 @@ module ActiveRecord end def interpolate(sql, record = nil) - if sql.respond_to?(:to_proc) + if sql.respond_to?(:to_proc) && !sql.is_a?(Hash) owner.send(:instance_exec, record, &sql) else sql diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb index becf1a3f62..7aaa24d767 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -146,7 +146,7 @@ module ActiveRecord private def interpolate(conditions) - if conditions.respond_to?(:to_proc) + if conditions.respond_to?(:to_proc) && !conditions.is_a?(Hash) instance_eval(&conditions) else conditions diff --git a/activerecord/lib/active_record/associations/preloader/association.rb b/activerecord/lib/active_record/associations/preloader/association.rb index 85b1040049..44b4164e9b 100644 --- a/activerecord/lib/active_record/associations/preloader/association.rb +++ b/activerecord/lib/active_record/associations/preloader/association.rb @@ -113,7 +113,7 @@ module ActiveRecord end def process_conditions(conditions) - if conditions.respond_to?(:to_proc) + if conditions.respond_to?(:to_proc) && !conditions.is_a?(Hash) conditions = klass.send(:instance_eval, &conditions) end |