Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed the to_xml case (closes #4201) [twoggle@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3925 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Mar 18, 2006
1 parent 9d7de52 commit 8b8a30d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions activesupport/lib/active_support/core_ext/hash/conversions.rb
Expand Up @@ -21,13 +21,11 @@ def to_xml(options = {})
options[:builder].instruct! unless options.delete(:skip_instruct)

options[:builder].__send__(options[:root].to_s.dasherize) do
for key in keys
value = self[key]

case value.class.to_s # TODO: Figure out why I have to to_s the class to do comparisons in order for tests to run
when "Hash"
each do |key, value|
case value
when ::Hash
value.to_xml(options.merge({ :root => key, :skip_instruct => true }))
when "Array"
when ::Array
value.to_xml(options.merge({ :root => key, :children => key.to_s.singularize, :skip_instruct => true}))
else
type_name = XML_TYPE_NAMES[value.class.to_s]
Expand Down

0 comments on commit 8b8a30d

Please sign in to comment.