emberjs/data — pull request #869 by teddyzeenny (2013-04-09 15:35:05+00:00)
Title: Failing test for finding one record whose id was loaded in hasMany

Failing test for the following bug:

When an id of a record is already loaded through a `hasMany` relationship, `findById` on this record no longer triggers the adapter's `find` method.

Example:

```javascript
App.Post = DS.Model.extend({
comments: DS.hasMany('App.Comment')
});
```

if `post = App.Post.find(1)` returns:

```json
"post": {
"id": 1,
"comment_ids": [1, 2]
}
```

When we later call `App.Comment.find(1)` or `App.Comment.find(2)` the store assumes they are already loaded and doesn't call `Adapter#find` and the records get stuck in the `loading` state.

The only way to fetch these records from the server is to use `post.get('comments')`.

I did a git bisect and it seems the issue started after this: 6f7c13dc50823028e3ee9c2907af4cc5328131ff