danielspaniel/ember-data-factory-guy — pull request #45 by ksykulev (2014-12-27 04:10:16+00:00)
Title: handleFindQuery json payload must be an array

I noticed that if you do not pass in an array into handleFindQuery stuff breaks somewhat silently and ember data returns no results. Seems like an obvious one, but I added a small validation so people don't get confused.

```
var car = FactoryGuy.build('car'); //single car { id: 1, name: 'Model S', year: 2014 }
testHelper.handleFindQuery('car', ['year', 'name'], car);
```

We get into extractArray, and map.call(payload[prop]) executes over an object and it returns an empty array.
```
extractArray: function(store, primaryType, rawPayload) {
...
var normalizedArray = map.call(payload[prop], function(hash) {
return typeSerializer.normalize(type, hash, prop);
}, this);
...
}
```