emberjs/data — pull request #2593 by jmurphyau (2014-12-14 12:56:27+00:00)
Title: EmbeddedRecordsMixin with Multiple Stores

This pull request is related to issue #2588.

When using more then one store the EmbeddedRecordsMixin fails.

These changes remove the EmbeddedRecordsMixin#normalise function (breaking change?) and define 3 new methods used on serialisers:
* pushIntoStore
* pushManyIntoStore
* loadRecordArray (not yet tested)

This is a first attempt at this and I'm not 100% that these methods are in the right place but the rationale behind it was I didn't think it made sense that the normalize function shouldn't be pushing data to the store.

If implemented in this way it may make sense that extractSingle/extractArray also use these functions rather than push to the store themselves. Also thinking now that if implemented in this way the normalize function should be returned but deprecated if possible?

As a consequence of doing these changes another issue was discovered (see [comments](https://github.com/jmurphyau/data/commit/3b86a4afeea78e2107778fc0e4e436bf7e2fd1cb#diff-f33931d6152ee09540f3827cd4d64417R226)) and some tests have been changed to explicitly work around this. I'll investigate this a bit more and log it as a separate issue.

This is my first pull request on GitHub and I'm not sure on how they work (can it be updated later with new commits?) - but I don't expect this to be implemented as is. If it's decided to be implemented like this I would expect some more changes are required (e.g. documentation, issue above resolved, deprecated warnings (?), etc). I wanted to log this to get thoughts on the implementation before doing those things.