sproutcore/sproutcore — pull request #1179 by dcporter (2014-02-21 18:33:39+00:00)
Title: New nested record implementation

A new nested record implementation which does away with the needless splitting up of nested records. Tests are included. (A rebased and bug-fixed version of @mauritslamers's original #1104.)

Main differences:
- where originally the store had the task of keeping track of parent and child records, this is now taken over by SC.Record. From the perspective of the store a nested record becomes a normal record.
- Changes bubble up from inside: a change inside the nested records bubbles up to the main record and gets written to the store there.
- No search possible for child records in the store.

Areas still to discuss:
- When the store changes the order of hashes in a nested array, the records will change to reflect the changes, as the record objects retrieve their attributes based on the position in the child array. I am not sure this is a desirable behaviour, but the only solution to fix it it that the nested records keep a cache of their hash to compare to when things change from the store. It would then have to be an item-per-item compare, as references are unlikely to be the same.

_writeAttribute code was contributed by https://github.com/mitchless