287 Commits

Author SHA1 Message Date
Jeremy Ashkenas
09fca1dc7e Merge pull request #3663 from jridgewell/collection-set-style-compat
Collection#set style (Backwards Compatible)
2015-08-18 17:35:20 -04:00
Justin Ridgewell
a6e2f0fb54 Test null set doesn't clear model.
https://github.com/jashkenas/backbone/pull/3663#discussion_r36124174
2015-08-07 13:20:41 -04:00
John-David Dalton
0bc02af704 Use some, includes, map in tests instead of any, include, pluck. 2015-08-07 01:58:09 -07:00
Linus-A. M. Gubenis
d6dd17c1ee typos 2015-07-13 09:50:11 -05:00
Linus-A. M. Gubenis
a37d30a3e1 Update collection.js 2015-07-13 09:43:55 -05:00
sophietk
0d43789682 Fix test for IE7/IE8 build 2015-06-24 10:25:45 +02:00
sophietk
007a1b85f4 Collection methods from underscore (reject, filter, some, every, ...) take function, set of model attributes, or attribute name as argument
- Expand the use of inherited underscore methods, to iteratee as function, object or string
- Apply iteratee transformation to groupBy, countBy, sortBy, indexBy
2015-06-11 18:04:30 +02:00
Justin Ridgewell
c40396228b Fix incorrect test 2015-06-10 14:26:37 -04:00
Justin Ridgewell
0052c2fc5c Keep backwards compatibility with v1 2015-06-03 20:59:59 -04:00
Justin Ridgewell
a082d2fdf9 Return only added or merged models
Mirrors the change in #3512.
2015-06-03 02:53:40 -04:00
Justin Ridgewell
e81474880b Don't bother with Collection#set unless models 2015-06-03 02:52:57 -04:00
Justin Ridgewell
fdea29dfc8 Collection#add shouldn't parse a model instance
Fixes #3636, but in a backwards compatible way.
2015-06-02 14:06:50 -04:00
Andrey Kuzmin
ffa4fa597d Added failing test case 2015-06-02 13:58:13 -04:00
Justin Ridgewell
c95d9775e7 Revert "Merge pull request #3644 from jridgewell/collection-parse"
This reverts commit ff57b54cbb, reversing
changes made to 5ea158506f.
2015-06-02 13:55:21 -04:00
Justin Ridgewell
13de636df1 Ensure fetch'd data is only parsed once 2015-05-30 02:27:51 -04:00
Justin Ridgewell
415c3a7a13 Collection#set shouldn't parse
Fixes #3636, #2824.

Reverts #1407.
2015-05-30 02:27:51 -04:00
Justin Ridgewell
61e765087d Test that Collection#remove _only_ returns removed models
Add (currently) failing tests for #3512.
2015-05-27 11:42:42 -04:00
Justin Ridgewell
dba0faad09 Collection#invoke should collect arguments
Fixes https://github.com/jashkenas/backbone/issues/3610.
2015-05-15 20:26:58 -04:00
Jeremy Ashkenas
bc73e25c5e Fixes #3512 2015-05-13 18:03:53 -04:00
Jeremy Ashkenas
a1c65e2420 s/updated/update 2015-05-13 17:39:05 -04:00
Jeremy Ashkenas
3150eec295 merged in 'updated' 2015-05-13 17:37:54 -04:00
Adam Krebs
401fdbd02c Merge branch 'master' into bb-120
Conflicts:
	index.html
2015-03-20 11:44:34 -04:00
Adam Krebs
74fdd620d7 fix comma at end of collections test 2015-02-22 11:58:06 -05:00
Adam Krebs
4fd9da4f81 style tweaks 2015-02-17 19:24:35 -05:00
Kevin Partington
b331afede1 Small style tweaks per akre54's comments on the pull request. 2015-02-17 19:13:19 -05:00
Adam Krebs
19f9905fec Merge branch 'master' into bb-120
Conflicts:
	backbone.js
	docs/backbone.html
	test/collection.js
	test/events.js
2015-02-13 17:20:43 -05:00
Kevin Partington
1088d18a21 Collection#fetch, Model#save, Model#fetch, and Model#destroy should all pass extra sync options to success callbacks. 2015-02-10 20:28:20 -06:00
Kevin Partington
780c84744a Collection#create passes extra options added by model sync to success callback 2015-02-10 19:59:22 -06:00
Jeremy Ashkenas
713c288475 Merge pull request #3455 from jridgewell/listenTo-memory-leak
Fix listenTo memory leak
2015-02-03 14:16:15 -05:00
Jeremy Ashkenas
c1ce7a7484 Merge pull request #3423 from jridgewell/ajax_context
Call the success callback with context
2015-02-02 13:48:49 -05:00
Justin Ridgewell
0c200ca31f Delete events hash if there are none. 2015-01-24 14:56:10 -05:00
Brad Dunbar
1b0c67bdf8 Collection#set - options.at accepts a string.
Closes #3353.
2015-01-23 06:33:15 -05:00
James Hartig
8569f8985c Collection.add accepts negative indexes for the at option 2015-01-22 17:38:12 -05:00
Adam Krebs
04f912ca38 Code style cleanup in collection tests and add an extra sort test 2015-01-22 17:38:12 -05:00
James Hartig
545a12ec8e Order should trigger a sort iff order was changed 2015-01-22 17:38:12 -05:00
robrobbins
51084c63a0 use number of assertions, not another var 2015-01-22 17:38:12 -05:00
robrobbins
a35d88ee81 listen for invalid, not error 2015-01-22 17:38:11 -05:00
admangum
2878091da6 clone options passed to reset 2015-01-22 17:38:08 -05:00
Adam Krebs
342b24b9b3 don't just test for the presence of options, test that it points to the same object as passed in. 2015-01-22 17:38:08 -05:00
Hadrien Milano
b4f65f7aa1 fix wrong test: collection.model must be a function 2015-01-22 17:38:08 -05:00
Hadrien Milano
5025d3ce71 fix flawed test 2015-01-22 17:38:08 -05:00
JD Isaacks
7e4f140072 Set correct number of assertions 2015-01-22 17:38:07 -05:00
JD Isaacks
63790cd1d6 Add test for negative indexes in at method 2015-01-22 17:38:07 -05:00
Justin Ridgewell
c2b2a71c29 Call the success callback with context
Fixes https://github.com/jashkenas/backbone/issues/3283.
2014-12-22 12:01:28 -05:00
James Hartig
c3b09ddb98 Collection.add accepts negative indexes for the at option 2014-11-14 16:06:14 -05:00
Adam Krebs
0519e7df6f Code style cleanup in collection tests and add an extra sort test 2014-11-13 12:06:44 -05:00
Adam Krebs
bc88f125f1 Merge pull request #3381 from fastest963/orderSort
Order should trigger a sort iff order was changed
2014-11-13 11:43:29 -05:00
James Hartig
787ee49d7e Order should trigger a sort iff order was changed 2014-11-13 11:39:11 -05:00
robrobbins
f2fe23e339 use number of assertions, not another var 2014-11-12 15:12:05 -07:00
robrobbins
51d076c9be listen for invalid, not error 2014-11-11 12:45:52 -07:00