ember-data-model-fragments icon indicating copy to clipboard operation
ember-data-model-fragments copied to clipboard

Question about modification merges

Open joegaudet opened this issue 6 years ago • 0 comments

Less of an issue and more of a question.

Standard ED model behaviour looks like this:


const foo = Model.extend({
  foo: attr(),
  bar: attr()
});

// say foo and bar have changed on the server

foo.set('foo', 'qux');
foo.reload();

// I will only get the remote change to bar as foo is locally dirty

Given a case using fragments:


const frag = Fagment.extend({
  foo: attr(),
  bar: attr()
});

const foo = Model.extend({
  baz: fragment('frag')
});

// say foo and bar have changed on the server

foo.set('baz.bar', 'qux');
foo.reload();

// I will get no changes from the fragment and my local copy will be preserved

Is this expected behavior?

joegaudet avatar Mar 22 '18 21:03 joegaudet