This project is archived and is in readonly mode.

#4506 ✓resolved
Lawrence Pit

to_xml with :include should skip_instruct on the included records

Reported by Lawrence Pit | April 30th, 2010 @ 01:40 AM | in 3.0.2

When calling e.g. record.to_xml(@person, :include => [:company]) the xml output has multiple xml instruct elements. For example:

<?xml version="1.0" encoding="UTF-8"?>
<company>
  <name>Company A</name>
  <id>662</id>
  <people>
    <inspect/>
    <?xml version="1.0" encoding="UTF-8"?>
    <person>
      <name>Person A</name>
      <id>677</id>
    </person>
    <inspect/>
    <?xml version="1.0" encoding="UTF-8"?>
    <person>
      <name>Person A</name>
      <id>677</id>
    </person>
  </people>
</company>

Attached patch fixes this.

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

Referenced by

Pages