Skip to content

Instantly share code, notes, and snippets.

@svparijs
Created December 17, 2012 15:34
Show Gist options
  • Save svparijs/4319161 to your computer and use it in GitHub Desktop.
Save svparijs/4319161 to your computer and use it in GitHub Desktop.
App.Person = DS.Model.extend({
firstName: DS.attr('string'),
lastName: DS.attr('string'),
fullName: function() {
return this.get('firstName') + ' ' + this.get('lastName');
}.property('firstName', 'lastName'),
didLoad: function() {
console.log(this.get('fullName') +" finished loading.");
},
isDiry: function() {
App.store.commit();
}.observes('completed')
});
App.Person = DS.Model.reopen({
namingConvention: {
keyToJSONKey: function(key) {
return key;
},
foreignKey: function(key) {
return key;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment