anandts88 / ember-validator

Perform Ember Object Validation
MIT License
5 stars 6 forks source link

Unique property value. #2

Closed Gabiras12 closed 8 years ago

Gabiras12 commented 8 years ago

Hi! I've tried to make a custom validation that verifies if the property value is unique in all records on ember-data. The problem is that the validators don't wait the findAll promises be resolved to validate de object. Any ideas on how can I make this?

anandts88 commented 8 years ago

@Gabiras12 This validator is designed with an assumption that we will have all the data before doing validation. In your case we would suggest to make a call to findAll promise in routes model or afterModel hook, so that result of findAll promise will be part of your model.