Created
January 16, 2013 14:17
-
-
Save SweeD/4547376 to your computer and use it in GitHub Desktop.
Sad try to to use a DS.Model and DS.Store up and running.
This file contains 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
When I try to find a model in the console, i get an error. | |
MyApp.User.find(98) | |
> TypeError: Object Ember has no method 'merge' |
This file contains 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
MyApp.Store = DS.Store.extend | |
revision: 11 |
This file contains 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
attr = DS.attr | |
MyApp.User = DS.Model.extend | |
alias: attr('string') | |
email: attr('string') | |
birthday: attr('date') | |
sex: attr('string') | |
countryCode: attr('string') | |
firstName: attr('string') | |
lastName: attr('string') | |
addresses: DS.hasMany('GleichklangWeb.Address') | |
fullName: (-> | |
return "#{@get('firstName')} #{@get('lastName')}" | |
).property('firstName', 'lastName') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment