lcoq / ember-validations

Ember-Validations - An Ember.js library for handling object validations
MIT License
122 stars 25 forks source link

FormatValidator fails on undefined value #12

Closed yossi-shasho closed 11 years ago

yossi-shasho commented 11 years ago

When FormatValidator is the only validation attached to a property, when validating without a property value, an exception is thrown.

lcoq commented 11 years ago

I just fixed this bug (see 78e8cb4).

A property value that does not respond to match function is replaced by an empty string. Consequently, the matching is made even for a falsy value. if you don't want this behavior, you can set the allowBlank option to true.

Let me know if you have any trouble or suggestion with this behavior.