{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/6515","repository_url":"https://api.github.com/repos/sequelize/sequelize","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/6515/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/6515/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/6515/events","html_url":"https://github.com/sequelize/sequelize/issues/6515","id":173797099,"number":6515,"title":"Promise in getterMethods","user":{"login":"kol9n93","id":8199096,"avatar_url":"https://avatars.githubusercontent.com/u/8199096?v=3","gravatar_id":"","url":"https://api.github.com/users/kol9n93","html_url":"https://github.com/kol9n93","followers_url":"https://api.github.com/users/kol9n93/followers","following_url":"https://api.github.com/users/kol9n93/following{/other_user}","gists_url":"https://api.github.com/users/kol9n93/gists{/gist_id}","starred_url":"https://api.github.com/users/kol9n93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kol9n93/subscriptions","organizations_url":"https://api.github.com/users/kol9n93/orgs","repos_url":"https://api.github.com/users/kol9n93/repos","events_url":"https://api.github.com/users/kol9n93/events{/privacy}","received_events_url":"https://api.github.com/users/kol9n93/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-08-29T15:08:48Z","updated_at":"2016-08-30T07:06:45Z","closed_at":"2016-08-29T15:13:44Z","body":"I wanna do the following getter in my model:\r\n```\r\ngetterMethods: {\r\n      objectLabel: function() {\r\n         if (this.zoneId) {\r\n          db.WarehouseZone.findOne({\r\n            where: {\r\n              id: this.zoneId\r\n            }\r\n          }).then(zone => {\r\n            return `${zone.zoneId}-${this.aisle}-${this.bin}-${this.level}`;\r\n          });\r\n         } else {\r\n          return `${this.aisle}-${this.bin}-${this.level}`;\r\n         }\r\n        return `${this.zoneId ? `${this.zoneId}-` : ''}${this.aisle}-${this.bin}-${this.level}`;\r\n      }\r\n    }\r\n```\r\n\r\nHow can I do that with promises? Is here exists any callback or something other?"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/243351732","html_url":"https://github.com/sequelize/sequelize/issues/6515#issuecomment-243351732","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/6515","id":243351732,"user":{"login":"janmeier","id":1210224,"avatar_url":"https://avatars.githubusercontent.com/u/1210224?v=3","gravatar_id":"","url":"https://api.github.com/users/janmeier","html_url":"https://github.com/janmeier","followers_url":"https://api.github.com/users/janmeier/followers","following_url":"https://api.github.com/users/janmeier/following{/other_user}","gists_url":"https://api.github.com/users/janmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/janmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janmeier/subscriptions","organizations_url":"https://api.github.com/users/janmeier/orgs","repos_url":"https://api.github.com/users/janmeier/repos","events_url":"https://api.github.com/users/janmeier/events{/privacy}","received_events_url":"https://api.github.com/users/janmeier/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T07:06:45Z","updated_at":"2016-08-30T07:06:45Z","body":"What have you done?"}}
{"actor":{"display_login":"janmeier"}}