Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving with EmbeddedRecordsMixin does not update related models dirty attributes #4552

Closed
ewoody opened this issue Sep 26, 2016 · 6 comments · Fixed by #6272
Closed

Saving with EmbeddedRecordsMixin does not update related models dirty attributes #4552

ewoody opened this issue Sep 26, 2016 · 6 comments · Fixed by #6272

Comments

@ewoody
Copy link

ewoody commented Sep 26, 2016

#2487 is still reproducible on "ember-data": "^2.4.0", "ember-cli": "2.7.0",

and it is big issue for performance while saving ember data.

Copied issue discription from #2487

No matter what way the serializer is configured in Ember dirty attributes of the relationships records are not updated with those from the response, non dirty attributes are updated though.

The only workaround I have found is to manually go through and mark them individually as willCommit and then didCommit by overriding save on the model - I tried doing this in the serializer for better encapsulation but couldn't get it to work.

If I've specified serialize: 'records' for my serializer when using EmbeddedRecordsMixin I would expect those records to be automatically set as saving/saved etc. along with the parent according to the normal save flow.

@fivetanley
Copy link
Member

Do you have an example model, payload, and serializer? It would be very helpful for us to try to track this down.

@wecc
Copy link
Contributor

wecc commented Oct 20, 2016

ping @ewoody ^

@hjdivad
Copy link
Member

hjdivad commented Oct 21, 2016

@igorT seems related to emberjs/rfcs#173

@ewoody
Copy link
Author

ewoody commented Oct 25, 2016

I will provide an example by Monday.

On 20 October 2016 at 23:37, Christoffer Persson notifications@github.com
wrote:

ping @ewoody https://github.com/ewoody ^


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4552 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AF0ikqPvlQfy_XgHO1FRVdoIiSMnYXRsks5q198ogaJpZM4KGeEi
.

@runspired
Copy link
Contributor

@ewoody did you ever make an example? This does not seem to be an issue anymore after #3868

@runspired
Copy link
Contributor

Anything not covered by #3868 is likely covered by #6272, will close with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants