Skip to content

Commit

Permalink
Ensure compatibility with Rails 4.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Nov 3, 2013
1 parent 246653a commit 7183c91
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/action_dispatch/xml_params_parser.rb
Expand Up @@ -26,7 +26,14 @@ def parse_formatted_parameters(env)
request.content_mime_type

if mime_type == Mime::XML
data = request.deep_munge(Hash.from_xml(request.body.read) || {})
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

data.with_indifferent_access
else
false
Expand Down

0 comments on commit 7183c91

Please sign in to comment.