ampersand-collection
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -134,3 +134,3 @@ var BackboneEvents = require('backbone-events-standalone'); | ||
var index = this._indexes[indexName || this.mainIndex]; | ||
return index[query] || index[query.id]; | ||
return index[query] || index[query.id] || this._indexes.cid[query.cid]; | ||
}, | ||
@@ -220,2 +220,3 @@ | ||
list.push(this.mainIndex); | ||
list.push('cid'); | ||
var l = list.length; | ||
@@ -222,0 +223,0 @@ this.models = []; |
{ | ||
"name": "ampersand-collection", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -5,0 +5,0 @@ "bugs": { |
@@ -104,2 +104,15 @@ var test = require('tape'); | ||
test('remove events for items that only have `cid`s', function (t) { | ||
t.plan(2); | ||
var c = new Collection(); | ||
var moe = new Stooge({name: 'moe'}); | ||
c.add(moe); | ||
c.on('remove', function (model, collection) { | ||
t.equal(collection, c); | ||
t.equal(model, moe); | ||
}); | ||
c.remove(moe); | ||
t.end(); | ||
}); | ||
test('comparator as a string', function (t) { | ||
@@ -106,0 +119,0 @@ var Coll = Collection.extend({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19200
404