diff options
4 files changed, 9 insertions, 3 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 34d14f1a80..28fc8959c1 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,9 @@ +* Support Ruby 2.3 by not unexpectedly calling `.to_proc` on Hash objects + + Fixes #25010 + + *tlrdstd* + ## Rails 3.2.22 (Jun 16, 2015) ## * No changes. 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 |