code style tweak

This commit is contained in:
Andrew Schaaf
2010-10-02 17:16:05 -04:00
parent 8b233a0151
commit b9b8a902e6

View File

@@ -236,6 +236,20 @@
return value;
},
// Return a copy of the model's attributes.
attributes : function() {
return _.clone(this._attributes);
},
// Bind all methods in the list to the model.
bindAll : function() {
_.bindAll.apply(_, [this].concat(arguments));
},
toString : function() {
return 'Model ' + this.id;
},
// Set a hash of model attributes, and sync the model to the server.
save : function(attrs, options) {
if (!this.resource) throw new Error(this.toString() + " cannot be saved without a resource.");
@@ -255,20 +269,6 @@
});
},
// Return a copy of the model's attributes.
attributes : function() {
return _.clone(this._attributes);
},
// Bind all methods in the list to the model.
bindAll : function() {
_.bindAll.apply(_, [this].concat(arguments));
},
toString : function() {
return 'Model ' + this.id;
},
// Destroy this model on the server.
destroy : function(options) {
if (this.collection) this.collection.remove(this);