-
-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Safe set for setDeep #471
Safe set for setDeep #471
Conversation
This resolves issues with properties that are consumed in the template
Not sure if this is the way to test this PR... Just giving some feedback... // package.json
Unfortunatly still seeing issue #468 |
@basz Would you mind trying again? If you don't mind inspecting the node_modules and see if these changes made it in there? |
Hmm. Looks like the values are set correctly now... 🎉 However, for nested keys my validations don't seem to run... That could be because I'm coming from the v2 releases of
anything obvious I should be aware of? |
Awesome! What does it mean that nested validations don't run? If |
I'm confused. should the validationsMap for nested keys be like version 2. {
'key1': [validations],
'key2.nested1': [validations],
} or (nested pojo's)
|
nested pojo's. Using the dot separated version was very limiting for cases detailed in places in #379 |
ok thanks. We should change that on the README... Search for "specify nested keys with dot delimiters"... |
That solved the validation when I edit a field. However, when I submit the form I do the following
Errors is then empty, alert is false, whilst it shouldn't... |
@basz If there was a minimal repo of this issue, would be happy to take a look! |
There seems to be a problem (or at least a difference between v2 and v3) with detecting the keys to be validated. When calling |
I could do something like https://github.com/hughsk/flat on the validationMap and feed it into the validate method... But I'll wait until you confirm it isn't something validate should do by itself and is indeed a difference between v2 and v3... |
@basz Interesting! We do have tests for |
Yeah, I went through the tests an found it... It's not working on nested keys. So given; {
'key1': [validations],
'key2': {
'nested1': [validations],
}
} and then calling |
currently working around with
|
Oh interesting! Mind filing an issue? Nested keys have always been a sore spot. By moving away from dot separated (v3), we solved most of the issues. This just seems to be a missed edge by me. |
see #478 |
Thank you @snewcomer for fixing the latest issues and taking care of this package. My upgrade path has been smooth sailing since and ember-changeset is a pleasure to work with... |
Thank you for the |
close #468