diff --git a/addon/utils/merge-deep.ts b/addon/utils/merge-deep.ts index f82e0b74..3d697975 100644 --- a/addon/utils/merge-deep.ts +++ b/addon/utils/merge-deep.ts @@ -97,7 +97,7 @@ function mergeTargetAndSource(target: any, source: any, options: Options): any { // else safe key on object if (propertyIsOnObject(target, key) && isMergeableObject(source[key]) && !source[key].hasOwnProperty('value')) { - target[key] = mergeDeep(options.safeGet(target, key), options.safeGet(source, key), options); + options.safeSet(target, key, mergeDeep(options.safeGet(target, key), options.safeGet(source, key), options)); } else { let next = source[key]; if (next && next instanceof Change) { diff --git a/tests/dummy/app/components/changeset-form.ts b/tests/dummy/app/components/changeset-form.ts index c4a1a51a..e9d8f9e3 100644 --- a/tests/dummy/app/components/changeset-form.ts +++ b/tests/dummy/app/components/changeset-form.ts @@ -4,7 +4,10 @@ import Changeset from 'ember-changeset' export default class ChangesetForm extends Component { model = { - email: 'something' + user: { + email: 'something' + }, + cid: '1' } changeset = new Changeset(this.model) diff --git a/tests/dummy/app/templates/components/changeset-form.hbs b/tests/dummy/app/templates/components/changeset-form.hbs index eee2fd44..7160acb7 100644 --- a/tests/dummy/app/templates/components/changeset-form.hbs +++ b/tests/dummy/app/templates/components/changeset-form.hbs @@ -1,15 +1,26 @@ -