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.

Add :margin option to XmlSerializer

#2698

When building custom XML with XmlSerializer (for ActiveRecord) its nice to be able to use the margin option of XMLBuilder rather than reformatting the string output or instantiating a builder.


builder = options[:builder] ||= ::Builder::XmlMarkup.new(:indent => options[:indent], :margin => options[:margin])

Reported by blythe · May 22nd, 2009 @ 06:44 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from serializer, xml to bugmash, serializer, xml

    August 6th, 2009 @ 02:48 PM

  2. ThePhred
    ThePhred

    I was able to modify the patch to get it to cleanly apply. Tests still pass.
    I've attached a patch.

    August 9th, 2009 @ 07:14 PM

  3. Rizwan Reza
    Rizwan Reza

    verified

    +1 The patch applies cleanly to 2-3-stable and all the tests pass.

    This doesn't work for master though.

    August 9th, 2009 @ 07:18 PM

  4. Elad Meidar
    Elad Meidar

    +1 Verified +1 patch applies for 2-3-stable with all tests.

    i think that on master you can simply specify :margin in a to_xml block.

    August 9th, 2009 @ 07:38 PM

  5. Derander
    Derander

    +1 verified, patch applies to 2-3-stable, all tests pass.

    I agree with Elad, this shouldn't be necessary in master.

    August 9th, 2009 @ 09:00 PM

  6. josh
    josh
    • State changed from new to invalid

    I don't think yet another option to the to_xml hash is going solve the worlds problems. We need a more robust way to override to_xml and do your own customizations.

    August 10th, 2009 @ 02:29 AM

  7. Jeremy Kemper
    Jeremy Kemper
    • Tag changed from bugmash, serializer, xml to serializer, xml
    • Milestone cleared.

    August 10th, 2009 @ 02:37 AM