Permalink
Browse files

Cleanup the Rails 4.1 compatibility patch

  • Loading branch information...
1 parent 7183c91 commit d68697c780d40365be0d1f81d09027858dd2d6f1 @dhh dhh committed Nov 3, 2013
Showing with 3 additions and 7 deletions.
  1. +3 −7 lib/action_dispatch/xml_params_parser.rb
@@ -26,14 +26,10 @@ def parse_formatted_parameters(env)
request.content_mime_type
if mime_type == Mime::XML
- if defined?(::ActionDispatch::Request::Utils)
- # Rails 4.1
- data = Request::Utils.deep_munge(Hash.from_xml(request.body.read) || {})
- else
- # Rails 4.0
- data = request.deep_munge(Hash.from_xml(request.body.read) || {})
- end
+ # Rails 4.1 moved #deep_munge out of the request and into ActionDispatch::Request::Utils
+ munger = defined?(Request::Utils) ? Request::Utils : request
+ data = munger.deep_munge(Hash.from_xml(request.body.read) || {})
data.with_indifferent_access
else
false

0 comments on commit d68697c

Please sign in to comment.