guillaumepotier / validator.js

Powerful objects and strings validation in javascript for Node and the browser
http://validatorjs.org
MIT License
255 stars 39 forks source link

Fix groups on Extended method without context #54

Closed ricardogama closed 8 years ago

ricardogama commented 8 years ago

This PR updates Extended method to implicitly create an instance if it's called without context. This way Extended can now be called without context (as is) to use validation groups (just like Assert), which currently throws an error.

ricardogama commented 8 years ago

@ruimarinho @guillaumepotier Please review.

ricardogama commented 8 years ago

@guillaumepotier @ruimarinho ping

guillaumepotier commented 8 years ago

Seems good. But a test in test suite is missing to be merged :)

Best

ricardogama commented 8 years ago

@guillaumepotier Done!

guillaumepotier commented 8 years ago

Seems good. WDYT @ruimarinho?

ruimarinho commented 8 years ago

I can confirm there is an issue with group support when using static methods but this PR does not fix it. Please take a look at https://github.com/guillaumepotier/validator.js/pull/55 instead.