diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-03 19:10:33 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-03 19:10:33 -0300 |
commit | 18d19bf2a418f4e310e7792db6d8600c25f8b1b3 (patch) | |
tree | 5bf7a7c61ba83de56feb524635d0213d35ebd2e0 /actionpack | |
parent | 5146f3af05b2784d0e6c2ea7bcf3f223289b75f0 (diff) | |
parent | 223e118a3c829a76ecf1d9d7e30c2cc488e203fb (diff) | |
download | rails-18d19bf2a418f4e310e7792db6d8600c25f8b1b3.tar.gz rails-18d19bf2a418f4e310e7792db6d8600c25f8b1b3.tar.bz2 rails-18d19bf2a418f4e310e7792db6d8600c25f8b1b3.zip |
Merge pull request #15349 from tgxworld/remove_duplicated_method_call
Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/http/parameters.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 4 | ||||
-rw-r--r-- | actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb | 5 |
3 files changed, 3 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/http/parameters.rb b/actionpack/lib/action_dispatch/http/parameters.rb index 1ab11392ce..5f7627cf96 100644 --- a/actionpack/lib/action_dispatch/http/parameters.rb +++ b/actionpack/lib/action_dispatch/http/parameters.rb @@ -15,7 +15,6 @@ module ActionDispatch query_parameters.dup end params.merge!(path_parameters) - params.with_indifferent_access end end alias :params :parameters diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index dfe258e463..4d4b443fb4 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -291,7 +291,7 @@ module ActionDispatch # Override Rack's GET method to support indifferent access def GET - @env["action_dispatch.request.query_parameters"] ||= Utils.deep_munge((normalize_encode_params(super) || {})) + @env["action_dispatch.request.query_parameters"] ||= Utils.deep_munge(normalize_encode_params(super || {})) rescue TypeError => e raise ActionController::BadRequest.new(:query, e) end @@ -299,7 +299,7 @@ module ActionDispatch # Override Rack's POST method to support indifferent access def POST - @env["action_dispatch.request.request_parameters"] ||= Utils.deep_munge((normalize_encode_params(super) || {})) + @env["action_dispatch.request.request_parameters"] ||= Utils.deep_munge(normalize_encode_params(super || {})) rescue TypeError => e raise ActionController::BadRequest.new(:request, e) end diff --git a/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb b/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb index 9a77454f30..1de05cbf09 100644 --- a/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb @@ -130,10 +130,7 @@ class UrlEncodedParamsParsingTest < ActionDispatch::IntegrationTest end test "ambiguous params returns a bad request" do - with_routing do |set| - set.draw do - post ':action', to: ::UrlEncodedParamsParsingTest::TestController - end + with_test_routing do post "/parse", "foo[]=bar&foo[4]=bar" assert_response :bad_request end |