I refrained from creating a new Trac ticket for ARes, which will be
affected if both of these patches are accepted by Core.
There are a couple of workarounds for this issue, but it would be nice
for AR, AS and ARes to output valid XML and resolve to namespaced
models correctly from XML respectively. Currently #to_xml on
ActiveRecord::Base and Array creates invalid XML output for namespaced
models.
Comments are appreciated and I am open to creating a RubyGem or Rails
Plugin to fix this issue if it seems that the Core team do not want to
fix this in Rails any time soon.
An XML namespace has to be declared to be valid xml, so the patches
submitted seem to leave us in the same situation where .to_xml will
produce invalid xml.
So given Module::Model, the only options I can think of are
<module_model> or <model>? Which is better or worse for your
particular situation?
That sounds like a reasonable option. Perhaps something else worth
considering is that overriding the root element for a given model
class is a little hard. Perhaps that's a sign we should be refactoring
the serialization a little?
I'm also looking at a refactoring that will make it easy to have the
same flexibility in to_json as in to_xml. I probably won't get to it
for a week or two at this rate, but if someone beats me to it I won't
mind too much...