Don't validate type for blank values

Another case where a validation is implying ValuePresence when it shouldn't be.
This should be the last case as now all the nodes that use ValuePresence have
been fixed.
Aye, XmlSectionBuilder requires active_support/core_ext/object/blank on
line 4. I want to let nil through but I also need to let empty strings and
the like through as NOT NULL DB fields will give back an empty string
instead of nil but when processing the XML these are essentially the same
thing as far as HMRC are concerned. Either way, they don't want to know.

--
Regards,
Harry Mills

On Mon, Nov 3, 2014 at 12:58 PM, James Bell <notifications@github.com>
wrote:

> In lib/hermod/validators/type_checker.rb:
>
> > @@ -24,7 +24,7 @@ def initialize(expected_class, &block)
> >        private
> >
> >        def test
> > -        checker.call(value)
> > +        value.blank? || checker.call(value)
>
> blank? isn't core Ruby; it's provided by ActiveSupport:
> http://api.rubyonrails.org/classes/Object.html#method-i-blank-3F
> I actually note you're using it elsewhere in the gem as well, and I'm not
> sure how the tests are passing without it being defined. Presumably for the
> type checker you don't want to allow Nil values, so nil? (which is
> defined on Object) is no good for you?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/fac/hermod/pull/9/files#r19731005>.
>