aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2015-08-28 00:45:44 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2015-08-28 00:45:44 -0500
commit3cc7b0a239c66af39acc979d9afa9e7c593c1f4b (patch)
tree53c4860b9e37945446af801788e462e8acd8faf8 /actionpack/lib
parent2a6071a5e81cbc3b83625f5e6d5aff61c69f1720 (diff)
parentfa216dc3b6b49660fabc6b8de41a63b1185fd8cb (diff)
downloadrails-3cc7b0a239c66af39acc979d9afa9e7c593c1f4b.tar.gz
rails-3cc7b0a239c66af39acc979d9afa9e7c593c1f4b.tar.bz2
rails-3cc7b0a239c66af39acc979d9afa9e7c593c1f4b.zip
Merge pull request #21396 from rodzyn/code-cleanup
Code cleanup
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/http/parameters.rb11
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb4
2 files changed, 2 insertions, 13 deletions
diff --git a/actionpack/lib/action_dispatch/http/parameters.rb b/actionpack/lib/action_dispatch/http/parameters.rb
index 277207ae6e..3c9f8cd9e4 100644
--- a/actionpack/lib/action_dispatch/http/parameters.rb
+++ b/actionpack/lib/action_dispatch/http/parameters.rb
@@ -1,6 +1,3 @@
-require 'active_support/core_ext/hash/keys'
-require 'active_support/core_ext/hash/indifferent_access'
-
module ActionDispatch
module Http
module Parameters
@@ -34,14 +31,6 @@ module ActionDispatch
def path_parameters
get_header(PARAMETERS_KEY) || {}
end
-
- private
-
- # Convert nested Hash to HashWithIndifferentAccess.
- #
- def normalize_encode_params(params)
- ActionDispatch::Request::Utils.normalize_encode_params params
- end
end
end
end
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index e6387768de..7276c57d28 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -332,7 +332,7 @@ module ActionDispatch
# Override Rack's GET method to support indifferent access
def GET
get_header("action_dispatch.request.query_parameters") do |k|
- set_header k, normalize_encode_params(super || {})
+ set_header k, Request::Utils.normalize_encode_params(super || {})
end
rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e
raise ActionController::BadRequest.new(:query, e)
@@ -342,7 +342,7 @@ module ActionDispatch
# Override Rack's POST method to support indifferent access
def POST
get_header("action_dispatch.request.request_parameters") do
- self.request_parameters = normalize_encode_params(super || {})
+ self.request_parameters = Request::Utils.normalize_encode_params(super || {})
end
rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e
raise ActionController::BadRequest.new(:request, e)