Don't override backbone.sync globally; only inside recline.Dataset.

This commit is contained in:
mjuniper
2013-12-10 15:24:21 -07:00
parent 6adf5eeb12
commit f96099513e

View File

@@ -52,6 +52,10 @@ my.Dataset = Backbone.Model.extend({
} }
}, },
sync: function(method, model, options) {
return this.backend.sync(method, model, options);
},
// ### fetch // ### fetch
// //
// Retrieve dataset and (some) records from the backend. // Retrieve dataset and (some) records from the backend.
@@ -635,9 +639,9 @@ my.ObjectState = Backbone.Model.extend({
// ## Backbone.sync // ## Backbone.sync
// //
// Override Backbone.sync to hand off to sync function in relevant backend // Override Backbone.sync to hand off to sync function in relevant backend
Backbone.sync = function(method, model, options) { // Backbone.sync = function(method, model, options) {
return model.backend.sync(method, model, options); // return model.backend.sync(method, model, options);
}; // };
}(this.recline.Model)); }(this.recline.Model));