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

Embedded records in old rest API have type attribute values lowercased #3726

Closed
iammer opened this issue Sep 3, 2015 · 2 comments
Closed

Comments

@iammer
Copy link

iammer commented Sep 3, 2015

I am using Ember-data 2.0.0.

I have a model sent from the server using the old REST API with embedded records. It looks like this using the old rest API.

{
  parent: {
    children: [{
      type: 'SOMEVALUE'
    }]
  }
}

Type is an attribute of the child model.

When the child record is added to the store type is changed from 'SOMEVALUE' to 'somevalue'.

I believe this is caused by the extractRelationship method in JSONSerializer. The relationshipHash.type is sent through Ember.string.dasherize. Which works for the JSONAPI and for polymorphic types, but isn't the correct thing to do for embedded records in the old REST API.

@pangratz
Copy link
Member

Hey @iammer, thanks for reporting! This is reproduced in http://ember-twiddle.com/7f0cde397742775ab97c and a fix is proposed in #3837.

@pangratz
Copy link
Member

pangratz commented Jan 2, 2016

I think this issue can be closed since #3837 has been merged.

@bmac bmac closed this as completed Jan 2, 2016
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

No branches or pull requests

3 participants