{"action":"closed","issue":{"url":"https://api.github.com/repos/keystonejs/keystone/issues/2812","repository_url":"https://api.github.com/repos/keystonejs/keystone","labels_url":"https://api.github.com/repos/keystonejs/keystone/issues/2812/labels{/name}","comments_url":"https://api.github.com/repos/keystonejs/keystone/issues/2812/comments","events_url":"https://api.github.com/repos/keystonejs/keystone/issues/2812/events","html_url":"https://github.com/keystonejs/keystone/issues/2812","id":154034077,"number":2812,"title":"Better documentation/error handling regarding relationship paths","user":{"login":"jstockwin","id":8227759,"avatar_url":"https://avatars.githubusercontent.com/u/8227759?v=3","gravatar_id":"","url":"https://api.github.com/users/jstockwin","html_url":"https://github.com/jstockwin","followers_url":"https://api.github.com/users/jstockwin/followers","following_url":"https://api.github.com/users/jstockwin/following{/other_user}","gists_url":"https://api.github.com/users/jstockwin/gists{/gist_id}","starred_url":"https://api.github.com/users/jstockwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstockwin/subscriptions","organizations_url":"https://api.github.com/users/jstockwin/orgs","repos_url":"https://api.github.com/users/jstockwin/repos","events_url":"https://api.github.com/users/jstockwin/events{/privacy}","received_events_url":"https://api.github.com/users/jstockwin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2016-05-10T15:20:41Z","updated_at":"2016-05-15T15:24:15Z","closed_at":"2016-05-15T15:24:15Z","body":"It appears that the `path` needs to be the plural of the model you are referencing.\r\n\r\nIn the docs we see the example of \r\n`User.relationship({ path: 'posts', ref: 'Post', refPath: 'author' });`\r\n\r\nBut in this case changing `path` to anything other than `posts` causes problems. The [docs](http://keystonejs.com/docs/database/#relationship-definitions) say:\r\n\"`path` - the path of the relationship reference on the Model\"\r\nwhich I don't think quite makes this clear. \r\n\r\nFurther, if you do set it to something other than posts, no errors are ever thrown, but the admin ui stops working properly, and the browsers console logs errors like:\r\n`Uncaught TypeError: Cannot read property 'expandColumns' of undefined`\r\nbut if you didn't open your browsers console you'd never see any error messages, it just wouldn't work properly. \r\n\r\n\r\nIs it intended that that `path` has to be the name of the model the relationship is with? \r\nIf yes, could the documentation be clearer here? Should we add some kind of check that throws a meaningful error for this?\r\nIf no, then this is a bug that needs fixing. "}}