introduce modelNameFromPayloadKey and deprecate typeForRoot - #3034
Merged
Conversation
fivetanley
force-pushed
the
new-serialization-hooks
branch
from
April 29, 2015 22:45
05eba94 to
bb50646
Compare
Contributor
|
Looks good to me. @igorT thoughts? |
fivetanley
force-pushed
the
new-serialization-hooks
branch
2 times, most recently
from
May 4, 2015 19:08
e449546 to
60030a4
Compare
fivetanley
force-pushed
the
new-serialization-hooks
branch
4 times, most recently
from
May 14, 2015 14:55
2c979cf to
64a5ed4
Compare
Contributor
There was a problem hiding this comment.
I'm unsure of the context in this transition doc, but this suggests returning modelName as non-dasherized. Is incorrect.
Introduced in this commit is payloadKeyFromModelName, which allows you
to specify the outgoing root key for a model name in the JSON payload.
For example:
```javascript
RESTSerializer.extend({modelNameFromPayloadKey: Ember.String.underscore});
```
```json
{
"taco-party": { }
}
```
becomes
```json
{
"taco_party"
}
```
For symmetry, modelNameFromPayloadKey has been introduced to
look up the ember data record in the store given a JSON root
key. This used to be called pathForType, which has been deprecated.
fivetanley
force-pushed
the
new-serialization-hooks
branch
from
May 16, 2015 16:36
64a5ed4 to
de43733
Compare
mixonic
added a commit
that referenced
this pull request
May 16, 2015
introduce modelNameFromPayloadKey and deprecate typeForRoot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduced in this commit is payloadKeyFromModelName, which allows you
to specify the outgoing root key for a model name in the JSON payload.
For example:
{ "taco-party": { } }becomes
{ "taco_party": {} }For symmetry, modelNameFromPayloadKey has been introduced to
look up the ember data record in the store given a JSON root
key. This used to be called pathForType, which has been deprecated.
Part of the refactor stuff covered in #2821 (comment)