Open sapryniukt opened 2 years ago
We ran into the issue of losing prototype and incorrect invocation of setDeep when tried to change the EmberData property in the changeset.
setDeep
EmberData
changeset
My changeset looked something like this:
data: { "name": "Jim Bob", "address": CountryModel { "country": "US", "address1": "", } }
but after execution:
changeset.set("address.address1", "some");
We got:
changes: { "name": "Jim Bob", "address": Object { "address1": "some", } }
Looks like findSiblings works well with POJO, but doesn't consider Class object. I proppose a simple solution to this by using
findSiblings
Object.setPrototypeOf(obj, prototype)
or
Object.create(prototype)
Also the tests that check and reproduce the issue have been added.
We ran into the issue of losing prototype and incorrect invocation of
setDeep
when tried to change theEmberData
property in thechangeset
.My
changeset
looked something like this:but after execution:
We got:
Looks like
findSiblings
works well with POJO, but doesn't consider Class object. I proppose a simple solution to this by usingor
Also the tests that check and reproduce the issue have been added.