This project is archived and is in readonly mode.

#1160 ✓invalid
deadlyicon

scoped models serialize into invalid xml

Reported by deadlyicon | October 2nd, 2008 @ 11:21 PM

The ActiveRecord::XmlSerializer creates invalid xml when serializing models within a scope.


>> puts Myscope::Mymodel.first.to_xml
<myscope/mymodel>
...
</myscope/mymodel>

This xml is invalid because you are not allowed slashes in a node name. The invalid node name is caused by the way XmlSerializer converts a model's class name into the xml root string


record.class.to_s.underscore

( in xml_serializer.rb on lines 180 and 223 )

I offer this as a possible fix


record.class_name.underscore

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages