lib/model_xml/generator.rb in model_xml-1.0.3 vs lib/model_xml/generator.rb in model_xml-1.0.4
- old
+ new
@@ -96,10 +96,10 @@
raise "ModelXML unable to parse #{field.inspect}"
end
# if the content responds to to_xml, call it passing the current builder
if content.respond_to?(:to_xml)
- content.to_xml(options.merge(:builder => xml, :skip_instruct => true))
+ content.to_xml(options.merge(:builder => xml, :skip_instruct => true, :root => tag.to_s))
# otherwise create the tag normally
else
xml.tag! tag, content
end