ghempton/data — pull request #1 by thingista (2013-02-13 20:26:03+00:00)
Title: Adding failing test - Two level hierarchy

Hi Gordon,

As discussed, added a test with Post hasMany Comments hasMany Lines. It fails when both Comments and Lines are set with {embedded: always}.

With the change I suggested in my note earlier, all tests are successful.

```javascript
function createNestedPromise(node) {
var promise = node.promise(store, adapter);
if((node.children.length > 0) && (promise)){ // Here
promise = promise.pipe(function() {
var childPromises = Ember.A(node.children.map(createNestedPromise)).compact();
return jQuery.when.apply(jQuery, childPromises);
});
}
return promise;
}
```

Thanks
PJ