emberjs/data — pull request #2223 by ppcano (2014-08-26 11:17:09+00:00)
Title: [sync_ssot] async belongsTo returns the resolved PromiseProxy when the record is not `isLoading` or `isEmpty`

The use case is shown at the included test where a nested resource needs to access an async relationship to compose its resource URI through `buildURL`.

This change could be unnecessary if **`buildURL` result becomes a Promise**. I do not know if this has been discussed before, but this may be required when a record must access any relationship to create its resource URI.

At this point, there are still some cases where the relationship bound data is not accesible in spite of its relationship has already been loaded.

For example this failing test:

```js
test('buildURL - buildURL takes a record from create to query a resolved async belongsTo relationship (2)', function() {
Comment.reopen({ post: DS.belongsTo('post', {async: true}) });

var postID = 2,
commentID = 1;

ajaxResponse({ posts: [{ id: postID }] });

store.find('post', postID).then(async(function(post) {
equal(post.get('id'), postID);

adapter.buildURL = function(type, id, record) {
return "/posts/" + record.get('post.id') + '/comments/';
};

ajaxResponse({ comments: [{ id: commentID, post: postID}] });

store.find('comment', commentID).then(async(function(comment) {
equal(comment.get('id'), commentID);

comment.save().then(async(function(post) {
// it would work if comment.get('post') is resolved before
equal(passedUrl, '/posts/'+postID+'/comments/');
}));

}));

}));

});
```