From 5e836127663f96ef6597f7dcdac3d14cc052fce3 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 27 Feb 2008 23:11:08 +0000 Subject: Fix Hash#from_xml with Type records. Closes #9242 [Juanjo Bazan, Isaac Feliu] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8937 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/hash/conversions.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb index 470537fe24..3d6a8d8588 100644 --- a/activesupport/lib/active_support/core_ext/hash/conversions.rb +++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb @@ -211,8 +211,9 @@ module ActiveSupport #:nodoc: elsif value.blank? || value['nil'] == 'true' nil # If the type is the only element which makes it then - # this still makes the value nil - elsif value['type'] && value.size == 1 + # this still makes the value nil, except if type is + # a xml node(where type['value'] is a Hash) + elsif value['type'] && value.size == 1 && !value['type'].is_a?(::Hash) nil else xml_value = value.inject({}) do |h,(k,v)| -- cgit v1.2.3