documentcloud/backbone — pull request #2171 by gsamokovarov (2013-01-21 14:48:56+00:00)
Title: Add deep comparison support for Collection#where

Sometimes I have nested resources in my API responses and I often find myself trying to search for the whole nested resource.

Let me give you an example if my wording is kinda confusing:

```coffee
class Check extends Backbone.Model
unsubscribe: ->
Subscription.unsubscribe(this)

class Subscription extends Backbone.Model
# The response looks like `[{id: 1, check: {id: 1}}]`
@unsubscribe: (check) ->
@where(check: check.attributes).invoke('destroy')
```

The drawback it that it is slowing down `Collection#where` a bit, but I find it pretty useful. Tell me what you guys think. If you like it I can open a PR for underscore too.