mirror of
https://github.com/github/rails.git
synced 2026-02-03 10:45:01 -05:00
Pull file from xml value only if it's a Hash. Closes #8190.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6583 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -173,7 +173,7 @@ module ActiveSupport #:nodoc:
|
||||
|
||||
# Turn { :files => { :file => #<StringIO> } into { :files => #<StringIO> } so it is compatible with
|
||||
# how multipart uploaded files from HTML appear
|
||||
if xml_value && xml_value["file"].is_a?(StringIO)
|
||||
if xml_value.is_a?(Hash) && xml_value["file"].is_a?(StringIO)
|
||||
xml_value["file"]
|
||||
else
|
||||
xml_value
|
||||
@@ -218,4 +218,4 @@ module ActiveSupport #:nodoc:
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -572,6 +572,12 @@ class HashToXmlTest < Test::Unit::TestCase
|
||||
assert_equal expected, hash.to_xml(@xml_options)
|
||||
end
|
||||
end
|
||||
|
||||
def test_empty_string_works_for_typecast_xml_value
|
||||
assert_nothing_raised do
|
||||
Hash.send(:typecast_xml_value, "")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class QueryTest < Test::Unit::TestCase
|
||||
|
||||
Reference in New Issue
Block a user