emberjs/data — pull request #576 by yipdw (2013-01-04 06:27:08+00:00)
Title: JsonSerializer's serialization for embedded has-many relationships ignores relationships

When serializing a has-many relationship on a model object, `DS.JSONSerializer` serializes _all_ records in _all_ has-many relationships on that model object. Therefore, if a model has multiple embedded has-many relationships, the serialized form of that model object will contain the same set of records in each relationship.

This can be seen by adding another has-many relationship to the `Post` model in `tests/integration/embedded/embedded_without_ids_test.js`, not adding any code to add records to that relationship, adjusting the `deepEqual` assertions to expect empty arrays as the serialization result, and running the changed tests.

This pull request contains an implementation of the above test suite change as well as a proposed fix. All comments are, of course, welcome -- I'm still finding my way around the Ember Data codebase and tests.