lcoq/ember-validations — pull request #11 by sohara (2012-11-21 04:25:10+00:00)
Title: allowBlank option on numericality validator

I don't intend this as a real pull request but I would like to get your feedback early on how best to implement this feature.

On the implementation: I've add a simple conditional on the `validate` method of `Ember.Validators.NumericalityValidator`. I'm not sure if this a too ugly way to do it? If I continue this way I would add this conditional to validate method of the other validators. Perhaps another way would be to implement this somehow in the parent `Ember.Validator` class. But this would meed the classes that extend `Ember.Validator` would need to all call `_super()` and then perhaps you lose the error handling to ensure they all have a `validate` function.

On the test: It's the simplest test, just to ensure blank strings are allow through. But it passes and none of the other tests are failing as a result.

If you have a moment, please let me know your thoughts on the best approach and I'll go back and revise.

Thanks,
Sean