diff options
7 files changed, 14 insertions, 5 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 5b45a13269..1395db3dc1 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -1,6 +1,7 @@ require "abstract_controller/base" require "action_view" require "active_support/core_ext/object/instance_variables" +require "active_support/hash_with_indifferent_access" module AbstractController class DoubleRenderError < Error @@ -138,7 +139,7 @@ module AbstractController end # Normalize args by converting render "foo" to render :action => "foo" and - # render "foo/bar" to render :file => "foo/bar". + # render "foo/bar" to render :app_template_file => "foo/bar". # :api: plugin def _normalize_args(action=nil, options={}) case action diff --git a/actionpack/lib/action_view/renderer/renderer.rb b/actionpack/lib/action_view/renderer/renderer.rb index 0f359899d6..5d783fe394 100644 --- a/actionpack/lib/action_view/renderer/renderer.rb +++ b/actionpack/lib/action_view/renderer/renderer.rb @@ -1,3 +1,5 @@ +require 'active_support/hash_with_indifferent_access' + module ActionView # This is the main entry point for rendering. It basically delegates # to other objects like TemplateRenderer and PartialRenderer which diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index de80b78272..7e62cb73dd 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -1693,7 +1693,7 @@ class MetalRenderWithoutAVTest < ActionController::TestCase def test_dynamic_params_render e = assert_raises ArgumentError do - get :dynamic_params_render, { inline: '<%= RUBY_VERSION %>' } + get :dynamic_params_render, { :inline => '<%= RUBY_VERSION %>' } end assert_equal "render parameters are not permitted", e.message end 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 |