This project is archived and is in readonly mode.
to_xml nil => true attribute should not appear when I skip types
-
CancelProfileIsBroken
- Tag set to bugmash
-
Dan Pickett
-1 verified that this occurs in 2-3-stable
:skip_types is to remove data types while nil="true" indicates that the value is nil. The desired behavior does not match the means to do it. Perhaps passing a different option is better (:explicit_nils or something?)
This would likely break a lot of legacy code, no?
-
Josh Nichols
I agree with Dan that skipping nils when you specify :skip_types seems to break the intention of it, which is to not include the type attribute with the class of the object. There'd also be the concern of backwards compatibility.
I'd +1 an extra option for this though, ie :skip_nil_values
-
Hugo Peixoto
-1 for the requested behaviour for skip_types. I'm with both Dan and Josh on this one.
I could add a skip_nil option to both activemodel and activesupport. Should I?
-
Derander
-1, verified behavior in 2-3-stable... I agree with Dan. I think that :skip_nils is a good idea Hugo, but it would probably be better as a new ticket.
-
Jeremy Kemper
- Assigned user cleared.
- Tag cleared.
- State changed from new to wontfix
- Milestone cleared.
-
Joshua White
Does this mean that the ability to not include the nil=>'true' is left to the individual to do themselves? Should I submit a patch? I am for adding a skip_nils attribute as well.