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
Have some array with objects inside of your changeset
Change the content of some objects in the array
Try to rollback/trigger validation
Expected Behavior
The content of the object in the array also rollbacks.
Validation triggers properly for in-array object keys.
Actual Behavior
The content of the objects in the array is not roll-backed after modification.
Impossible to make validation works for properties of nested objects. (except when a new object is added/deleted to the main array, but its not real-time for the properties of these objects)
Maybe i'm doing it the wrong way, i never saw support for this kind of structure and validation in ember-changeset, so let me know if it's a bug or just me !
Quick overview of the test case:
constvalidator={title: [validatePresence(true)],content: [validatePresence(true)],comments: [(e)=>{/** * Validates only when array is changed */console.log(e);returntrue;},],// not working'comments.0.content': [(e)=>{console.log(e);returntrue;},],};
...
Changeset({title: 'Article',comments: [{content: 'That was fun',<--contentdoesnotvalidatewhenmodifiedanddoesnotrollback},{content: 'That was not fun',},],lookupValidator(validator),
validator
})
The text was updated successfully, but these errors were encountered:
Note this appears to be related to the lookupValidator function, because if I use a standard validation object for the map, but use my own validation function, then it works fine.
VERSION
4.1.0
Test Case
Repo
The files
Steps to reproduce
[In the test case]
[In any changeset]
Expected Behavior
The content of the object in the array also rollbacks.
Validation triggers properly for in-array object keys.
Actual Behavior
The content of the objects in the array is not roll-backed after modification.
Impossible to make validation works for properties of nested objects. (except when a new object is added/deleted to the main array, but its not real-time for the properties of these objects)
Maybe i'm doing it the wrong way, i never saw support for this kind of structure and validation in ember-changeset, so let me know if it's a bug or just me !
Quick overview of the test case:
The text was updated successfully, but these errors were encountered: