aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/hash/conversions.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-07-13 00:44:09 +0000
committerRick Olson <technoweenie@gmail.com>2006-07-13 00:44:09 +0000
commit1ec9f8d049eda0c52a3045752ed447f371462676 (patch)
tree1b6294b8bd99df02229a79cc55855908c851a85a /activesupport/lib/active_support/core_ext/hash/conversions.rb
parent35f7cc23badaf51eca7d27b72613ab220d6936a6 (diff)
downloadrails-1ec9f8d049eda0c52a3045752ed447f371462676.tar.gz
rails-1ec9f8d049eda0c52a3045752ed447f371462676.tar.bz2
rails-1ec9f8d049eda0c52a3045752ed447f371462676.zip
Correctly convert <foo nil=true> to nil when using Hash.create_from_xml. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4607 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash/conversions.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/conversions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb
index 1e7f8eb68d..7927a39d44 100644
--- a/activesupport/lib/active_support/core_ext/hash/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb
@@ -101,7 +101,7 @@ module ActiveSupport #:nodoc:
else content
end
else
- value.empty? ? nil : value.inject({}) do |h,(k,v)|
+ value.empty? || value['nil'] == 'true' ? nil : value.inject({}) do |h,(k,v)|
h[k] = typecast_xml_value(v)
h
end