Created
May 17, 2011 15:16
-
-
Save MikailCliftov/976663 to your computer and use it in GitHub Desktop.
wtf part 2
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
Creating the record: | |
var record = Rapid.store.createRecord(Rapid.Check, { | |
guid: '@123' | |
}); | |
relationA.get('checks').pushObject(record); | |
... set up an observer on record status | |
Rapid.store.commitRecords(); | |
the record is created, but relationA.checks points to @123 instead of the storeKey's id (1000) | |
_createRecords: function(store, storeKeys) { | |
storeKeys.forEach(function(storeKey) { | |
var id = store.idFor(storeKey), | |
recordType = store.recordTypeFor(storeKey), | |
dataHash = store.readDataHash(storeKey), | |
fixtures = this.fixturesFor(recordType); | |
if (!id || (id.indexOf('@') >= 0) ) { | |
id = this.generateIdFor(recordType, dataHash, store, storeKey); | |
} | |
this._invalidateCachesFor(recordType, storeKey, id); | |
fixtures[id] = dataHash; | |
store.dataSourceDidComplete(storeKey, null, id); | |
}, this); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment