Add explicit_nil_handling option to codebase #34
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes issue 33 which requests that there be an option to specify how Builder treats nil values from initialization. Without specifying the explicit_nil_handling option as true, the codebase functions the same way.
yields an output of
as does
However, when a tag has a nil value, and the option is turned on, it adds a nil="true" attribute to the tag, in order to match the way Rails explicitly denotes nil values when rendering ActiveRecord objects as xml.
yields
commit 430b9762c436f180db8686407b5002cb4f71e8b9
Author: Dermot Haughey hderms@gmail.com
Date: Tue Jan 15 19:36:00 2013 -0600
commit b9adb4d916ae1cf897ea2c1f39f5ad0c0def4460
Author: Dermot Haughey hderms@gmail.com
Date: Tue Jan 15 19:35:50 2013 -0600
commit 8e8a7873b48e956e4642d31265dc767b5fafb096
Author: Dermot Haughey hderms@gmail.com
Date: Tue Jan 15 19:25:42 2013 -0600