{"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/860","labels_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/860/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/860/comments","events_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/860/events","html_url":"https://github.com/tgriesser/bookshelf/issues/860","id":98852424,"number":860,"title":"Calling fetch() on models returns null not undefined","user":{"login":"jadengore","id":1921464,"avatar_url":"https://avatars.githubusercontent.com/u/1921464?v=3","gravatar_id":"","url":"https://api.github.com/users/jadengore","html_url":"https://github.com/jadengore","followers_url":"https://api.github.com/users/jadengore/followers","following_url":"https://api.github.com/users/jadengore/following{/other_user}","gists_url":"https://api.github.com/users/jadengore/gists{/gist_id}","starred_url":"https://api.github.com/users/jadengore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadengore/subscriptions","organizations_url":"https://api.github.com/users/jadengore/orgs","repos_url":"https://api.github.com/users/jadengore/repos","events_url":"https://api.github.com/users/jadengore/events{/privacy}","received_events_url":"https://api.github.com/users/jadengore/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tgriesser/bookshelf/labels/discussion","name":"discussion","color":"fad8c7"},{"url":"https://api.github.com/repos/tgriesser/bookshelf/labels/docs","name":"docs","color":"0b02e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-08-03T22:46:03Z","updated_at":"2015-08-05T10:55:01Z","closed_at":null,"body":"If I fetch a model where `withRelated` is passed in as an option, the fetched model returned is null, not undefined. \r\n\r\nHowever I saw this in the docs for `fetch()`:\r\n> Fetches a model from the database, using any attributes currently set on the model to form a select query. Returns a promise, which will resolve with the fetched model, or undefined if the model isn't fetched. \r\n\r\nIs this normal behavior? If so, maybe update the documentation to reflect this change?\r\n\r\nEdit: My original title said `Calling fetch() with withRelated attribute returns null not undefined`, but it actually returns null not undefined for any case regardless of options for me."},"comment":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/comments/127954785","html_url":"https://github.com/tgriesser/bookshelf/issues/860#issuecomment-127954785","issue_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/860","id":127954785,"user":{"login":"abalmos","id":1865093,"avatar_url":"https://avatars.githubusercontent.com/u/1865093?v=3","gravatar_id":"","url":"https://api.github.com/users/abalmos","html_url":"https://github.com/abalmos","followers_url":"https://api.github.com/users/abalmos/followers","following_url":"https://api.github.com/users/abalmos/following{/other_user}","gists_url":"https://api.github.com/users/abalmos/gists{/gist_id}","starred_url":"https://api.github.com/users/abalmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abalmos/subscriptions","organizations_url":"https://api.github.com/users/abalmos/orgs","repos_url":"https://api.github.com/users/abalmos/repos","events_url":"https://api.github.com/users/abalmos/events{/privacy}","received_events_url":"https://api.github.com/users/abalmos/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T10:55:01Z","updated_at":"2015-08-05T10:55:01Z","body":":+1: on the proposed PR "}}