{"action":"created","issue":{"url":"https://api.github.com/repos/Vincit/objection.js/issues/190","repository_url":"https://api.github.com/repos/Vincit/objection.js","labels_url":"https://api.github.com/repos/Vincit/objection.js/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/Vincit/objection.js/issues/190/comments","events_url":"https://api.github.com/repos/Vincit/objection.js/issues/190/events","html_url":"https://github.com/Vincit/objection.js/issues/190","id":175926442,"number":190,"title":"either `from` or `to` must point to the owner model table.","user":{"login":"mariotacke","id":4942019,"avatar_url":"https://avatars.githubusercontent.com/u/4942019?v=3","gravatar_id":"","url":"https://api.github.com/users/mariotacke","html_url":"https://github.com/mariotacke","followers_url":"https://api.github.com/users/mariotacke/followers","following_url":"https://api.github.com/users/mariotacke/following{/other_user}","gists_url":"https://api.github.com/users/mariotacke/gists{/gist_id}","starred_url":"https://api.github.com/users/mariotacke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariotacke/subscriptions","organizations_url":"https://api.github.com/users/mariotacke/orgs","repos_url":"https://api.github.com/users/mariotacke/repos","events_url":"https://api.github.com/users/mariotacke/events{/privacy}","received_events_url":"https://api.github.com/users/mariotacke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-09T04:34:54Z","updated_at":"2016-09-09T05:01:30Z","closed_at":null,"body":"I'm having a hard time understanding this error: `Manager.relationMappings.user: join: either 'from' or 'to' must point to the owner model table.`. I have two classes, `Manager` and `User`; `Manager` is a sub-type to `User`.\r\n\r\n### Models\r\n```js\r\nclass User extends Model {\r\n  static get tableName () {\r\n    return 'user';\r\n  }\r\n}\r\n\r\nclass Manager extends Model {\r\n  static get tableName () {\r\n    return 'manager';\r\n  }\r\n\r\n  static get relationMappings () {\r\n    return {\r\n      user: {\r\n        relation: Model.HasOneRelation,\r\n        modelClass: User,\r\n        join: {\r\n          from: 'Manager.id',\r\n          to: 'User.id'\r\n        }\r\n      }\r\n    };\r\n  }\r\n}\r\n```\r\n\r\n### Query\r\n```js\r\nconst user = yield Manager\r\n  .query()\r\n  .joinRelation('user')\r\n```\r\n\r\nI tried setting up a corresponding relation on `User` but it did not make a difference. I am probably misunderstanding something... Love the lib thus far!"},"comment":{"url":"https://api.github.com/repos/Vincit/objection.js/issues/comments/245820013","html_url":"https://github.com/Vincit/objection.js/issues/190#issuecomment-245820013","issue_url":"https://api.github.com/repos/Vincit/objection.js/issues/190","id":245820013,"user":{"login":"mariotacke","id":4942019,"avatar_url":"https://avatars.githubusercontent.com/u/4942019?v=3","gravatar_id":"","url":"https://api.github.com/users/mariotacke","html_url":"https://github.com/mariotacke","followers_url":"https://api.github.com/users/mariotacke/followers","following_url":"https://api.github.com/users/mariotacke/following{/other_user}","gists_url":"https://api.github.com/users/mariotacke/gists{/gist_id}","starred_url":"https://api.github.com/users/mariotacke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariotacke/subscriptions","organizations_url":"https://api.github.com/users/mariotacke/orgs","repos_url":"https://api.github.com/users/mariotacke/repos","events_url":"https://api.github.com/users/mariotacke/events{/privacy}","received_events_url":"https://api.github.com/users/mariotacke/received_events","type":"User","site_admin":false},"created_at":"2016-09-09T05:01:30Z","updated_at":"2016-09-09T05:01:30Z","body":"Wow... thanks for answering this so quickly! Indeed, it was the lower-casing of the class name. Does this apply to the docs as well? They all seem Pascal-cased. \r\n\r\nBtw, i'm intentionally joining on primary key, because `Manager` is a sub-type to `User`.\r\n\r\nThanks!"}}
{"actor":{"display_login":"mariotacke"}}