-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added failing tests for saving embedded records #578
Added failing tests for saving embedded records #578
Conversation
I can confirm this exact problem. @NilsLattek have you found a workaround? |
Not yet. It might be possible to solve this using the new |
I have the exact same problem. There is also a question on SO: |
@bobey I think a newly created record (embedded or not) should be in a dirty state. I think the real problem here is that persistence is handled by separately for each record, instead of through the parent.
In both cases, persistence is handled through the parent. That said, I don't know exactly how to fix this, my understanding of the inner workings of ember data isn't deep enough. |
@sandstrom I just tested this one and it fixes the bug: https://github.com/emberjs/data/pull/629/files |
worked for me : https://github.com/emberjs/data/pull/629/files |
The first problem was fixed in: 3b91851 |
Seems to be fixed. |
Creating a new record and adding a new embedded record will result in two requests (embedded: 'always'):
The second request is not necessary, because the child is embedded in the first request.
Creating a new embedded record on an existing parent results in a POST request to the childs url. My understanding is that it should perform a PUT request to the parents' url with the child embedded.