Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

getAsync call options.error once #473

Merged
merged 1 commit into from

2 participants

@sventschui

If there were no models created, just refreshed options.error was never called. A solution would be to call options.error once

@sventschui sventschui getAsync call options.error once
In error callback of getAsync call options.once. If there where no models created, just refreshed options.error was never called.
e9e4fa2
@PaulUithol
Owner

That sounds pretty sane indeed; merging it, thanks!

@PaulUithol PaulUithol merged commit ff06667 into PaulUithol:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 15, 2014
  1. @sventschui

    getAsync call options.error once

    sventschui authored
    In error callback of getAsync call options.once. If there where no models created, just refreshed options.error was never called.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 backbone-relational.js
View
5 backbone-relational.js
@@ -1433,8 +1433,9 @@
var args = arguments;
_.each( created, function( model ) {
model.trigger( 'destroy', model, model.collection, options );
- options.error && options.error.apply( model, args );
});
+
+ options.error && options.error.apply(models, args);
},
url: setUrl
},
@@ -1450,8 +1451,8 @@
error: function() {
if ( _.contains( created, model ) ) {
model.trigger( 'destroy', model, model.collection, options );
- options.error && options.error.apply( model, arguments );
}
+ options.error && options.error.apply( models, arguments );
}
},
options
Something went wrong with that request. Please try again.