Well, I think I have it. This is close to my source code, but the updated filterWithIds function is here.
filterWithIds: function(ids) { return _(this.models.filter(function(c) { return _.contains(ids, c.id); })); }
For those who are next in CoffeeScript (I), here is the CoffeeScript version.
filterWithIds: (ids) -> _(@models.filter (c) -> _.contains ids, c.id)
This is my answer; any smell of code?
source share