{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/827","labels_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/827/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/827/comments","events_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/827/events","html_url":"https://github.com/strongloop/loopback-datasource-juggler/issues/827","id":127842068,"number":827,"title":"belongsTo method is not promisified","user":{"login":"jbcpollak","id":188558,"avatar_url":"https://avatars.githubusercontent.com/u/188558?v=3","gravatar_id":"","url":"https://api.github.com/users/jbcpollak","html_url":"https://github.com/jbcpollak","followers_url":"https://api.github.com/users/jbcpollak/followers","following_url":"https://api.github.com/users/jbcpollak/following{/other_user}","gists_url":"https://api.github.com/users/jbcpollak/gists{/gist_id}","starred_url":"https://api.github.com/users/jbcpollak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbcpollak/subscriptions","organizations_url":"https://api.github.com/users/jbcpollak/orgs","repos_url":"https://api.github.com/users/jbcpollak/repos","events_url":"https://api.github.com/users/jbcpollak/events{/privacy}","received_events_url":"https://api.github.com/users/jbcpollak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-21T04:22:31Z","updated_at":"2016-01-21T17:53:09Z","closed_at":null,"body":"Using loopback-datasource-juggler 2.44 I have found the belongsTo getter method does not return a promise. \r\n\r\nFor example, I have a model, say `Order` which has a belongsTo relationship with `Customer`.\r\n\r\nThis code does not work, although I would expect it to:\r\n\r\n     order.customer().then(customer => {\r\n         // do something with customer\r\n     }\r\n\r\nI've been using a promise-wrapping library to work around this, but it gets annoying everywhere I want to get the `customer` to first wrap the method and bind to the instance, then get the promise.\r\n\r\nI know promises are a work in progress, but according to the [documentation](https://github.com/strongloop/loopback/issues/418) I would think the DAO-level code should work now."},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/comments/173652802","html_url":"https://github.com/strongloop/loopback-datasource-juggler/issues/827#issuecomment-173652802","issue_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/827","id":173652802,"user":{"login":"jbcpollak","id":188558,"avatar_url":"https://avatars.githubusercontent.com/u/188558?v=3","gravatar_id":"","url":"https://api.github.com/users/jbcpollak","html_url":"https://github.com/jbcpollak","followers_url":"https://api.github.com/users/jbcpollak/followers","following_url":"https://api.github.com/users/jbcpollak/following{/other_user}","gists_url":"https://api.github.com/users/jbcpollak/gists{/gist_id}","starred_url":"https://api.github.com/users/jbcpollak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbcpollak/subscriptions","organizations_url":"https://api.github.com/users/jbcpollak/orgs","repos_url":"https://api.github.com/users/jbcpollak/repos","events_url":"https://api.github.com/users/jbcpollak/events{/privacy}","received_events_url":"https://api.github.com/users/jbcpollak/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T17:53:09Z","updated_at":"2016-01-21T17:53:09Z","body":"yup, that works, thanks. Its a bit confusing, but it works."}}