lcoq / ember-validations

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

Add validateContext to allow validation per specified context #29

Closed radek closed 6 years ago

radek commented 11 years ago

This will allow to have more then one validation rules per model. I.e. user model can be validated by main validate() method and/or validateContext('profileUpdate') method.

johnkpaul commented 11 years ago

:thumbsup: I really need this in my Ember application!

lcoq commented 10 years ago

Thank you @radek ! /cc @johnkpaul

I like the idea, but I think this is a bad idea to override the validations property.

The validate method could directly handle scopes. When a string is passed as argument (ie the context), it search the {context}Validations instead of validations. This could be a starting point, so the next version will use the #17 API suggestion.

Do you have any thoughts about that ?