Skip to content

Instantly share code, notes, and snippets.

@kuon
Created January 28, 2011 00:00
Show Gist options
  • Save kuon/799564 to your computer and use it in GitHub Desktop.
Save kuon/799564 to your computer and use it in GitHub Desktop.
_findRecord: function(recordType, id) {
var storeKey ;
// if a record instance is passed, simply use the storeKey. This allows
// you to pass a record from a chained store to get the same record in the
// current store.
if (recordType && recordType.get && recordType.get('isRecord')) {
storeKey = recordType.get('storeKey');
// otherwise, lookup the storeKey for the passed id. look in subclasses
// as well.
} else storeKey = id ? recordType.storeKeyFor(id) : null;
if (storeKey && (this.readStatus(storeKey) === SC.Record.EMPTY)) {
storeKey = this.retrieveRecord(recordType, id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment