{"action":"closed","issue":{"url":"https://api.github.com/repos/lytics/ember-data.model-fragments/issues/72","labels_url":"https://api.github.com/repos/lytics/ember-data.model-fragments/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/lytics/ember-data.model-fragments/issues/72/comments","events_url":"https://api.github.com/repos/lytics/ember-data.model-fragments/issues/72/events","html_url":"https://github.com/lytics/ember-data.model-fragments/issues/72","id":61182434,"number":72,"title":"Fragment values reset on changes after first save","user":{"login":"knownasilya","id":34726,"avatar_url":"https://avatars.githubusercontent.com/u/34726?v=3","gravatar_id":"","url":"https://api.github.com/users/knownasilya","html_url":"https://github.com/knownasilya","followers_url":"https://api.github.com/users/knownasilya/followers","following_url":"https://api.github.com/users/knownasilya/following{/other_user}","gists_url":"https://api.github.com/users/knownasilya/gists{/gist_id}","starred_url":"https://api.github.com/users/knownasilya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knownasilya/subscriptions","organizations_url":"https://api.github.com/users/knownasilya/orgs","repos_url":"https://api.github.com/users/knownasilya/repos","events_url":"https://api.github.com/users/knownasilya/events{/privacy}","received_events_url":"https://api.github.com/users/knownasilya/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-13T18:48:31Z","updated_at":"2015-05-20T21:20:04Z","closed_at":"2015-05-20T21:20:04Z","body":"Basically if you change a nested fragment's value, and then save the parent model it works. Now if you go and make another change, and save, it resets the value to the previous value upon save.\r\n\r\nHere's an example setup:\r\n\r\n```js\r\n// model\r\nexport default DS.Model.extend({\r\n  name: attr('string'),\r\n  subdomain: attr('string'),\r\n  settings: oneFragment('community-setting')\r\n});\r\n\r\n// community-setting fragment\r\nexport default DS.ModelFragment.extend({\r\n  disclaimer: oneFragment('settings-disclaimer'),\r\n  contact: oneFragment('settings-contact'),\r\n  links: manyFragments('settings-link'),\r\n  map: oneFragment('settings-map')\r\n});\r\n\r\n// settings-disclaimer fragment\r\nexport default DS.ModelFragment.extend({\r\n  showOnFirstVisit: attr('boolean'),\r\n  message: attr('string')\r\n});\r\n```\r\n\r\nIn the above code, if I modify `community.settings.disclaimer.message`, and `community.save()` it works fine. Now if I don't refresh the page, and change the value again, and hit save, the value is changed back to what it was last before this change.\r\n\r\nSo It's kind hard to create a jsbin with an ember-cli addon, so I hope this is enough."}}