jnunemaker/happymapper — pull request #31 by nerab (2014-02-20 21:42:21+00:00)
Title: Allow optional attributes with types other than String

This PR adds support for optional attributes with a type other than String.

Before, if an attribute was defined with a type other than String and was nil, `to_xml` failed with an error similar to:

TypeError in '#to_xml Address before(:all)'
wrong argument type Float (expected String)

The fix is pretty simple - always calling to_s on the value is the right thing to do for an attribute, because attributes are always text in XML.

There is an additional change that sets the Gemfile source to https://rubygems.org.