You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with ember-model-validator and EmberData 2.1 and I'm having an issue validating a belongsTo relationship. I'm using version 1.1.0 of ember-model-validator
When I call validate() the code is considered to be empty (but it's not).
I've managed to debug the issue to the following:
//model-validator.js_validatePresence: function_validatePresence(property,validation){varpropertyValue=this.get(property);// If the property is an async relationship.if(this._modelRelations()&&!Ember['default'].isBlank(this._modelRelations()[property])){propertyValue=this.get(property+'.content');// Here is the problem}if(Ember['default'].isBlank(propertyValue)){this.set('isValidNow',false);this._addToErrors(property,validation.presence,Messages['default'].presenceMessage);}},
If I console.log propertyValue, right before the this.get(property + .content') I get the following Class {store: Class, container: Container, _internalModel: ember$data$lib$system$model$internal$model$$InternalModel, isError: false, adapterError: (...)
But the this.get(property + '.content') returns undefined.... was it this way with older versions of Ember Data (I'm guessing that's my problem).
I've been dealing with this through custom validations, but it's kind of annoying to always do this:
@esbanarango - Thank you so much for fixing it insanely fast. I confirm that it's fixed, thanks again! I was able to delete a lot of code because of that 👍
Hey!
I'm working with ember-model-validator and EmberData 2.1 and I'm having an issue validating a belongsTo relationship. I'm using version 1.1.0 of ember-model-validator
I've create my model like the following
When I call validate() the
code
is considered to be empty (but it's not).I've managed to debug the issue to the following:
If I console.log
propertyValue
, right before thethis.get(property + .content')
I get the followingClass {store: Class, container: Container, _internalModel: ember$data$lib$system$model$internal$model$$InternalModel, isError: false, adapterError: (...)
But the this.get(property + '.content') returns undefined.... was it this way with older versions of Ember Data (I'm guessing that's my problem).
I've been dealing with this through custom validations, but it's kind of annoying to always do this:
Thanks a lot for the project. It's been very helpful
The text was updated successfully, but these errors were encountered: