Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Upgrade for Backbone 0.9.10 #146

Merged
merged 1 commit into from

2 participants

@mplatts

Stops error "Object has no method 'reset'" due to new fetch methods in latest backbone.

@ryanfitz ryanfitz merged commit ccdadc2 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 24, 2013
  1. @mplatts

    Upgrade for Backbone 0.9.10

    mplatts authored
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 0 deletions.
  1. +12 −0 vendor/assets/javascripts/backbone_rails_sync.js
View
12 vendor/assets/javascripts/backbone_rails_sync.js
@@ -62,6 +62,18 @@
if (complete) complete(jqXHR, textStatus);
};
+ var success = options.success;
+ params.success = function(resp) {
+ if (success) success(model, resp, options);
+ model.trigger('sync', model, resp, options);
+ };
+
+ var error = options.error;
+ params.error = function(xhr) {
+ if (error) error(model, xhr, options);
+ model.trigger('error', model, xhr, options);
+ };
+
// Make the request.
return $.ajax(params);
}
Something went wrong with that request. Please try again.