ember-changeset-cp-validations
ember-changeset-cp-validations copied to clipboard
validations seem to operate on the default value
Hi,
I'm having a hard time getting my Form pattern right with ember-bootstrap forms. Also I am a little unsure if this pattern is supported at all, nor if the issues I found are actually coming from this add-on.
setup ember-cli 2.16.2 my models are using fragments and have cp-validations defined on them. I'm now trying to get ember-changeset into the mix.
so to glue this all together I think I need ember-changeset-cp-validations
and ember-bootstrap-cp-validations
.
I have created a small demo app that show my desired setup.
Issue 1: the validations seem to operate on the default value of the model, not on actual mutations. I have confirmed that this is also true when I do not use any fragments.
Issue 2: Changing values on any of the fragments here results in an console error
[Error] Error: Property set failed: object in path "consumer.givenName" could not be found or was destroyed.
Could you please confirm or deny this pattern is correct in principle and if so what am i missing?Thanks a lot!
I understand from the maintainer of ember-changeset that the current version doesn't have support for nested keys. there is a PR for that https://github.com/poteto/ember-changeset/pull/206
That would explain or at least be related to the second issues. It does not explain the first issue I believe.