Skip to content

Instantly share code, notes, and snippets.

@iammerrick
Created May 23, 2011 22:30
Show Gist options
  • Save iammerrick/987774 to your computer and use it in GitHub Desktop.
Save iammerrick/987774 to your computer and use it in GitHub Desktop.
/* In Core */
store: SC.Store.create().from(SC.Record.fixtures)
/* fixtures/kpi_model_fixtures.js */
sc_require('models/kpi_model');
Builder.Kpi.FIXTURES = [
{
"guid": "1",
"name": "Customer Satisfaction",
"description": "Good for these kinds of uses.",
"rating": "4",
"popularity": "544",
"category": "HR",
"thumbUrl": "http://www.call-center-metrics.com/wp-content/uploads/2010/03/call-center_kpi.png"
}
];
/* models/kpi_model.js */
Builder.Kpi = SC.Record.extend({
name: SC.Record.attr(String),
description: SC.Record.attr(String),
rating: SC.Record.attr(Number),
popularity: SC.Record.attr(Number),
category: SC.Record.attr(String),
thumbUrl: SC.Record.attr(String)
});
/*
in console
records = Builder.store.find(Builder.Kpi)
records.objectAt(0).get('name')
records.objectAt(0) returns undefined.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment