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
///////////////////////////////////
// outerClass validations
///////////////////////////////////
this.get('outerClass.validations.isValid')
> false
this.get('outerClass.validations.messages')
> ["This field can't be blank"]
this.get('outerClass.validations.errors')
> []
///////////////////////////////////
// Access middleClass through validations.attrs
///////////////////////////////////
this.get('outerClass.validations.attrs.middleClass.isValid')
> false
this.get('outerClass.validations.attrs.middleClass.messages')
> ["This field can't be blank"]
this.get('outerClass.validations.attrs.middleClass.message')
> "This field can't be blank"
this.get('outerClass.validations.attrs.middleClass.errors')
> []
this.get('outerClass.validations.attrs.middleClass.error')
> undefined
///////////////////////////////////
// Access middleClass directly:
///////////////////////////////////
this.get('outerClass.middleClass.0.validations.messages')
> ["This field can't be blank"]
this.get('outerClass.middleClass.0.validations.errors')
> []
///////////////////////////////////
// Access innerClass through middleClass.validations.attrs
///////////////////////////////////
this.get('outerClass.middleClass.0.validations.attrs.innerClass.messages')
> ["This field can't be blank"]
this.get('outerClass.middleClass.0.validations.attrs.innerClass.errors')
> []
///////////////////////////////////
// Access innerClass directly
///////////////////////////////////
this.get('outerClass.middleClass.0.innerClass.0.validations.messages')
> ["This field can't be blank"]
this.get('outerClass.middleClass.0.innerClass.0.validations.errors')
> [Class]
As you can see, the innerClass has an error on it, but the hasMany is not propagating it.
Based on the documentation, it shouldn't be possible for errors to be empty but messages non-empty. In fact, based on (what I assume is) the code, it looks like error shouldn't ever be undefined
The text was updated successfully, but these errors were encountered:
BlueRaja
changed the title
Invalid object has 'message' property but no 'error' property
Has-many relationship propagates 'message' property but not 'error' property
Sep 23, 2020
BlueRaja
changed the title
Has-many relationship propagates 'message' property but not 'error' property
Has-many relationship propagates 'messages' property but not 'errors' property
Sep 23, 2020
Environment
Steps to Reproduce
Here is our setup, with doubly-nested classes. It might reproduce with only a single layer of nesting, though:
outerClass:
middleClass:
innerClass:
Here is what the data looks like:
As you can see, the
innerClass
has an error on it, but thehasMany
is not propagating it.Based on the documentation, it shouldn't be possible for
errors
to be empty butmessages
non-empty. In fact, based on (what I assume is) the code, it looks likeerror
shouldn't ever beundefined
The text was updated successfully, but these errors were encountered: