This project is archived and is in readonly mode.
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
-
Pratik January 18th, 2009 @ 06:07 AM
- Milestone cleared.
- State changed from new to incomplete
- Assigned user set to Pratik
Looks good. Missing tests.
-
Ryan Bigg April 10th, 2010 @ 11:23 AM
Tested in 2.3.5, this now outputs <scope-model>. I think this ticket can now be closed.
-
Ryan Bigg April 11th, 2010 @ 04:52 AM
- State changed from incomplete to invalid
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>