Created
May 23, 2011 22:30
-
-
Save iammerrick/987774 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
/* 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