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

Added documentation to modify the hash by reference #3967

Merged
merged 1 commit into from
Dec 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addon/serializers/json-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ export default Serializer.extend({
the payload and just sends the raw serialized JSON object.
If your server expects namespaced keys, you should consider using the RESTSerializer.
Otherwise you can override this method to customize how the record is added to the hash.
The hash property should be modified by reference.

For example, your server may expect underscored root objects.

Expand Down
1 change: 1 addition & 0 deletions addon/serializers/rest-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ var RESTSerializer = JSONSerializer.extend({

/**
You can use this method to customize the root keys serialized into the JSON.
The hash property should be modified by reference (possibly using something like _.extend)
By default the REST Serializer sends the modelName of a model, which is a camelized
version of the name.

Expand Down