Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

to_xml in ActiveSupport::CoreExtensions::Array::Conversions does not work well with namespaces

#925

If an array consists of elements of the same type that are namespaced, the resulting XML will consists of illegal names.

line 148: options[:root] ||= all? { |e| e.is_a?(first.class) && first.class.to_s != "Hash" } ? first.class.to_s.underscore.pluralize : "records"

If all the elements are of type 'Foo::FooBar', because of the call to 'underscore', the resulting root element will be <foo/foo_bars>, which is illegal XML syntax.

Reported by chemicalhen · August 28th, 2008 @ 04:11 PM

State: stale
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. chemicalhen
    chemicalhen

    A later call to .dasherize would actually make the resulting root element to be <foo/foo-bars>.

    August 28th, 2008 @ 04:19 PM

  2. jeff
    jeff

    +1 this has caught me several times..

    August 28th, 2008 @ 06:08 PM

  3. josh
    josh
    • State changed from new to stale

    Sounds interesting, got patch?

    Staling out for now.

    December 3rd, 2008 @ 03:30 PM