Skip to content

Instantly share code, notes, and snippets.

Created December 9, 2011 17:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Datastore example
MyApp = SC.Application.create({
store: SC.Store.create()
MyApp.MyRecord = SC.Record.extend();
MyApp.resourcePath = "myRecord";
// Load the record and save the storeKey
var storeKey =, {});
// Materialize a record instance
var recordInstance =;
// Determining which record we've got from the resourcePath property
var recordType = recordInstance.constructor.resourcePath;
// This would also work
recordType ='storeKey')).resourcePath;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment