This project is archived and is in readonly mode.

#669 ✓invalid
Oleg Richards

XML Root problem when model is in namespace

Reported by Oleg Richards | July 21st, 2008 @ 02:55 PM | in 2.x

If ActiveRecord model is placed in namespace for example: Animals::Dog, we have the following thing in to_xml:

attributes goes there

I think that this is not correct. I can use :root option to override root name, but why should i do it.

I've browsed a code and see the following:

root = (options[:root] || @record.class.to_s.underscore).to_s

i think that we should replace underscore method with regular expression, which will replace '::' with '_' and XML will be correct.

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

Pages