bitovi/canjs — pull request #324 by andykant (2013-05-25 23:40:45+00:00)
Title: Maximum Call Stack Exceeded When Destroying a nested model

I have a Player and Team model. Using the attributes plugin I have established the following associations:

1. A player has a team property which is a Team model
2. A team has a players property which is a Player model list

The resulting object as produced by models contains an infinite loop of players to teams to players. This is because there is only one instance of a model with a given ID in the store. The problem arises when you try and destroy a Player model.

You get a "maximum call stack exceeded" error.

You can see this at my fiddle:

http://jsfiddle.net/thecountofzero/KdVa5/

Enter the following in the console:

```js
can.when(players[2].destroy()).then(function(g) { console.dir(g) } )
```