Skip to content
This repository

Use `update` as default `fetch` method #2083

Closed
wants to merge 1 commit into from

4 participants

Casey Foster Adam Krebs Yuku TAKAHASHI Jeremy Ashkenas
Casey Foster
Collaborator

To continue discussion sparked in #2048

Adam Krebs
Collaborator

:+1:

Jeremy Ashkenas
Owner

Done.

Jeremy Ashkenas jashkenas closed this March 19, 2013
Casey Foster caseywebdev deleted the branch February 03, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Feb 05, 2013
Casey Foster Use `update` as default `fetch` method eadb4a1
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. 8  backbone.js
8  backbone.js
@@ -816,15 +816,15 @@
816 816
       return this;
817 817
     },
818 818
 
819  
-    // Fetch the default set of models for this collection, resetting the
820  
-    // collection when they arrive. If `update: true` is passed, the response
821  
-    // data will be passed through the `update` method instead of `reset`.
  819
+    // Fetch the default set of models for this collection, updating the
  820
+    // collection when they arrive. If `reset: true` is passed, the response
  821
+    // data will be passed through the `reset` method instead of `update`.
822 822
     fetch: function(options) {
823 823
       options = options ? _.clone(options) : {};
824 824
       if (options.parse === void 0) options.parse = true;
825 825
       var success = options.success;
826 826
       options.success = function(collection, resp, options) {
827  
-        var method = options.update ? 'update' : 'reset';
  827
+        var method = options.reset ? 'reset' : 'update';
828 828
         collection[method](resp, options);
829 829
         if (success) success(collection, resp, options);
830 830
       };
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.