Created
December 30, 2013 19:49
-
-
Save jberthet/8187113 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Model definition code | |
| Essaissprout.A = SC.Record.extend({ | |
| aProp: SC.Record.attr(String), | |
| bLink: SC.Record.toOne('Essaissprout.B', {inverse: 'aLink'}) | |
| }); | |
| Essaissprout.B = SC.Record.extend({ | |
| bProp: SC.Record.attr(String), | |
| aLink: SC.Record.toMany('Essaissprout.A', {inverse: 'bLink'}) | |
| }); | |
| // Test code I run into Firefox | |
| ES = Essaissprout; | |
| dataHash = {bProp: "Hello I'm B", aLink: []}; | |
| tmpId = SC.guidFor(dataHash); | |
| bRecord = ES.store.createRecord(ES.B, dataHash, tmpId); | |
| ES.store.commitRecord(ES.B, null, bRecord.get('storeKey')); | |
| dataHash = {aProp: "Hello I'm A", bLink: bRecord}; | |
| tmpId = SC.guidFor(dataHash); | |
| aRecord = ES.store.createRecord(ES.A, dataHash, tmpId); | |
| ES.store.commitRecord(ES.A, null, aRecord.get('storeKey')); | |
| // After that, if I check what is in bRecord, the attribute "aLink" is still empty ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment