emberjs/data — pull request #1265 by iterion (2013-09-10 05:56:54+00:00)
Title: Adding unloadAll method for store

I needed a way to unload all records for a certain type.

The `get('content').copy()` was necessary as just calling `forEach` on the record array would return undefined after the first record was deleted. I'm not sure if this is a bug, at the very least it's a little surprising. From what I can tell it's related to the filtering of the record array. I'd be happy to file an issue and investigate further if this is indeed a bug.

Failing test for that situation:
```javascript
test("when multiple records are loaded they can all be unloaded", function () {
var adam = env.store.push('person', {id: 1, name: "Adam Sunderland"});
var bob = env.store.push('person', {id: 2, name: "Bob Bobson"});

env.store.all('person').forEach(function(person) {
person.unloadRecord();
});

equal(env.store.all('person').get('length'), 0);
});
```