emberjs/data — pull request #1934 by bmac (2014-05-13 15:05:20+00:00)
Title: Implement JSONSerializer#serializeIntoHash to make it easier to use with...

... the RESTAdapter

Lately I've been using Ember Data with some legacy backends who's payload does not follow http://jsonapi.org/ conventions. This usually involves using the `JSONSerializer` to extract ember models from the response payload and the `RESTAdapter` to manage making requests to the backed. In order to get these 2 pieces working together I often extend or reopen `JSONSerialize` to implement a `serializeIntoHash` function and an `extractArray` function to work around issue #1479.

The combination of this pr and issue #1479, will allow developers to use the `JSONSerializer` with the `RESTAdapter` out of the box by simply making their `JSONSerializer` be the `ApplicationSerializer`.

```js
App.ApplicationSerializer = JSONSerializer;
```

Some examples of `serializeIntoHash` being implemented on the `JSONSerializer` used in the wild.
[ember-data-tastypie-adapter](https://github.com/escalant3/ember-data-tastypie-adapter/blob/1334bd4b2f2c020891df69ad768c70eb95fab9ee/packages/ember-data-tastypie-adapter/lib/tastypie_serializer.js#L180-L182)
[ember-data-django-tastypie](https://github.com/ddemid/ember-data-django-tastypie/blob/284399422350cbbd0ec15e6fc65f5a11fa96fe86/adapter.js)
[ember-data-sails-adapter](https://github.com/bmac/ember-data-sails-adapter#applicationserializer-1)