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

Add a test for embedded belongsTo create with id. #120

Merged

Conversation

benkonrath
Copy link
Collaborator

Ids for embedded beolongsTo aren't being sent when creating a record. My interpretation is that setting post: {serialize: 'id', deserialize: 'records'} in the serializer should allow the embedded record to work on retrieve but also allow the id to be set on create / update. The test shows that ED is sending null instead of the id.

I've included a couple of other cleanups / fixes in the PR. The belongsTo create is the relevant test. Any thoughts here?

@dustinfarris
Copy link
Owner

Is #115 related?

@dustinfarris
Copy link
Owner

or, more specifically, emberjs/data#3360

@benkonrath
Copy link
Collaborator Author

It didn't work with EDA 0.5.6 / ED 1.0.0-beta.18 as well so I suspect that it's not emberjs/data#3360. I'll have to keep digging.

@benkonrath benkonrath force-pushed the embedded-belongsTo-create-by-id branch from a934798 to 60095cc Compare July 17, 2015 19:10
@benkonrath
Copy link
Collaborator Author

Ok, so I was just doing it wrong. You need to set the full record and it will be serialized to the id. I've updated the test and it now passes. I think it's useful to have this in the integration tests as an example of how to do this.

@dustinfarris
Copy link
Owner

Agreed.

dustinfarris added a commit that referenced this pull request Jul 17, 2015
Add a test for embedded belongsTo create with id.
@dustinfarris dustinfarris merged commit 8e2a605 into dustinfarris:master Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants