emberjs/data — pull request #2408 by wecc (2014-10-22 17:05:12+00:00)
Title: Error when payload without id is pushed to the store

This is an attempt to fix #2401.

However, there's still one test failing test, see https://github.com/emberjs/data/blob/master/packages/ember-data/tests/integration/serializers/rest_serializer_test.js#L389-L409

The reason is that it uses `normalizeHash` to handle a custom named ID property name (wouldn't http://emberjs.com/api/data/classes/DS.JSONSerializer.html#property_primaryKey be the preferred way to do this?) and the code handling this (https://github.com/emberjs/data/blob/master/packages/ember-data/lib/serializers/rest_serializer.js#L178-L180) is run after `normalizeId`, where I've put the assert to check for the presence of an ID field.

Would like some input on what method would be recommended to proceed here:

1. Change the test to test something else than `_id` => `id`? Perhaps `_title` => `title`?
2. Move the code handling `normalizeHash` above the call to `normalizeId` (doesn't _feel_ right)
3. Not having the assert in `normalizeId` but instead put it in `normalize` in both JSONSerializer and RESTSerializer? (less DRY?)