This project is archived and is in readonly mode.
XmlSerializer with option skip_nils
-
Pratik
- Assigned user set to josh
- Tag changed from activecord, serialization, xml to activecord, patch, serialization, xml
-
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.
-
James Sanders
Is it unreasonable to suggest that adding options is a better interim solution than having no easy way to control the generated xml? It seems more consistent to be able to skip the nil attribute just like we can skip the type attribute. FWIW, I'm attaching patches with that behavior against 2.3 and master
-
bshand
A number of +1's (about 5) for a skip_nils or similar option are in related ticket #2049 to_xml nil => true attribute should not appear when I skip types.
