{"action":"created","comment":{"url":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/comments/54260228","id":54260228,"diff_hunk":"@@ -0,0 +1,35 @@\n+\"use strict\";\n+\n+var LinkingModels = require('sails-linking-models');\n+var ModelHelpers = require('../lib/ModelHelpers');\n+\n+const model = {\n+  schema: true,\n+  autoCreatedAt: true,\n+  autoUpdatedAt: true,\n+  autoPK: false,\n+  attributes: {\n+    person_id: {","path":"api/models/Detainees.js","position":12,"original_position":12,"commit_id":"8e993e1527611f3a0dea531cb730fe48a369a23c","original_commit_id":"bfd438cef3f2ed2d366763924ee0bd67e4f03630","user":{"login":"JoeChapman","id":1274835,"avatar_url":"https://avatars.githubusercontent.com/u/1274835?v=3","gravatar_id":"","url":"https://api.github.com/users/JoeChapman","html_url":"https://github.com/JoeChapman","followers_url":"https://api.github.com/users/JoeChapman/followers","following_url":"https://api.github.com/users/JoeChapman/following{/other_user}","gists_url":"https://api.github.com/users/JoeChapman/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeChapman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeChapman/subscriptions","organizations_url":"https://api.github.com/users/JoeChapman/orgs","repos_url":"https://api.github.com/users/JoeChapman/repos","events_url":"https://api.github.com/users/JoeChapman/events{/privacy}","received_events_url":"https://api.github.com/users/JoeChapman/received_events","type":"User","site_admin":false},"body":"And the same on Event model? Or can Event have something more meaningful given the context of the content, i.e,\r\n```js\r\nattributes: {\r\n    detainee: {\r\n        model: 'detainees'\r\n    }\r\n}\r\n```\r\n\r\nRather then what we currently have, which is:\r\n```js\r\nattributes: {\r\n    person_id: {\r\n        model: 'detainees'\r\n    }\r\n}\r\n```\r\nThe first example makes more sense to me because the model is not an id (string), it is an entity, and so should have a meaningful name?","created_at":"2016-02-26T15:51:47Z","updated_at":"2016-02-26T15:51:47Z","html_url":"https://github.com/UKHomeOffice/removals_integration/pull/134#discussion_r54260228","pull_request_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/134","_links":{"self":{"href":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/comments/54260228"},"html":{"href":"https://github.com/UKHomeOffice/removals_integration/pull/134#discussion_r54260228"},"pull_request":{"href":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/134"}}},"pull_request":{"url":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/134","id":60827068,"html_url":"https://github.com/UKHomeOffice/removals_integration/pull/134","diff_url":"https://github.com/UKHomeOffice/removals_integration/pull/134.diff","patch_url":"https://github.com/UKHomeOffice/removals_integration/pull/134.patch","issue_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/issues/134","number":134,"state":"open","locked":false,"title":"BM-533: Capture check in events","user":{"login":"JoeChapman","id":1274835,"avatar_url":"https://avatars.githubusercontent.com/u/1274835?v=3","gravatar_id":"","url":"https://api.github.com/users/JoeChapman","html_url":"https://github.com/JoeChapman","followers_url":"https://api.github.com/users/JoeChapman/followers","following_url":"https://api.github.com/users/JoeChapman/following{/other_user}","gists_url":"https://api.github.com/users/JoeChapman/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeChapman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeChapman/subscriptions","organizations_url":"https://api.github.com/users/JoeChapman/orgs","repos_url":"https://api.github.com/users/JoeChapman/repos","events_url":"https://api.github.com/users/JoeChapman/events{/privacy}","received_events_url":"https://api.github.com/users/JoeChapman/received_events","type":"User","site_admin":false},"body":"- Detainee model\r\n- Events model\r\n- findOrCreate detainee and event","created_at":"2016-02-26T11:14:36Z","updated_at":"2016-02-26T15:51:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e3a210467c000dd966220bb19e675b938b46767","assignee":{"login":"chrisns","id":715120,"avatar_url":"https://avatars.githubusercontent.com/u/715120?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisns","html_url":"https://github.com/chrisns","followers_url":"https://api.github.com/users/chrisns/followers","following_url":"https://api.github.com/users/chrisns/following{/other_user}","gists_url":"https://api.github.com/users/chrisns/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisns/subscriptions","organizations_url":"https://api.github.com/users/chrisns/orgs","repos_url":"https://api.github.com/users/chrisns/repos","events_url":"https://api.github.com/users/chrisns/events{/privacy}","received_events_url":"https://api.github.com/users/chrisns/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/134/commits","review_comments_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/134/comments","review_comment_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/issues/134/comments","statuses_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/statuses/8e993e1527611f3a0dea531cb730fe48a369a23c","head":{"label":"UKHomeOffice:feature/bm-533/capture-checkin-events","ref":"feature/bm-533/capture-checkin-events","sha":"8e993e1527611f3a0dea531cb730fe48a369a23c","user":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"repo":{"id":30912971,"name":"removals_integration","full_name":"UKHomeOffice/removals_integration","owner":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UKHomeOffice/removals_integration","description":"IRC Bedspace management tool","fork":false,"url":"https://api.github.com/repos/UKHomeOffice/removals_integration","forks_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/forks","keys_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/teams","hooks_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/hooks","issue_events_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/issues/events{/number}","events_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/events","assignees_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/assignees{/user}","branches_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/branches{/branch}","tags_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/tags","blobs_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/statuses/{sha}","languages_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/languages","stargazers_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/stargazers","contributors_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/contributors","subscribers_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/subscribers","subscription_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/subscription","commits_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/issues/comments{/number}","contents_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/contents/{+path}","compare_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/merges","archive_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/downloads","issues_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/issues{/number}","pulls_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls{/number}","milestones_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/milestones{/number}","notifications_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/labels{/name}","releases_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/releases{/id}","deployments_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/deployments","created_at":"2015-02-17T10:48:39Z","updated_at":"2016-01-19T08:39:41Z","pushed_at":"2016-02-26T15:42:33Z","git_url":"git://github.com/UKHomeOffice/removals_integration.git","ssh_url":"git@github.com:UKHomeOffice/removals_integration.git","clone_url":"https://github.com/UKHomeOffice/removals_integration.git","svn_url":"https://github.com/UKHomeOffice/removals_integration","homepage":"","size":5880,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"UKHomeOffice:feature/event-integration","ref":"feature/event-integration","sha":"157593c8fc0dd036e6ec60f2e5e287b30624b179","user":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"repo":{"id":30912971,"name":"removals_integration","full_name":"UKHomeOffice/removals_integration","owner":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UKHomeOffice/removals_integration","description":"IRC Bedspace management tool","fork":false,"url":"https://api.github.com/repos/UKHomeOffice/removals_integration","forks_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/forks","keys_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/teams","hooks_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/hooks","issue_events_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/issues/events{/number}","events_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/events","assignees_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/assignees{/user}","branches_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/branches{/branch}","tags_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/tags","blobs_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/statuses/{sha}","languages_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/languages","stargazers_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/stargazers","contributors_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/contributors","subscribers_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/subscribers","subscription_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/subscription","commits_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/issues/comments{/number}","contents_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/contents/{+path}","compare_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/merges","archive_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/downloads","issues_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/issues{/number}","pulls_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls{/number}","milestones_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/milestones{/number}","notifications_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/labels{/name}","releases_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/releases{/id}","deployments_url":"https://api.github.com/repos/UKHomeOffice/removals_integration/deployments","created_at":"2015-02-17T10:48:39Z","updated_at":"2016-01-19T08:39:41Z","pushed_at":"2016-02-26T15:42:33Z","git_url":"git://github.com/UKHomeOffice/removals_integration.git","ssh_url":"git@github.com:UKHomeOffice/removals_integration.git","clone_url":"https://github.com/UKHomeOffice/removals_integration.git","svn_url":"https://github.com/UKHomeOffice/removals_integration","homepage":"","size":5880,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/134"},"html":{"href":"https://github.com/UKHomeOffice/removals_integration/pull/134"},"issue":{"href":"https://api.github.com/repos/UKHomeOffice/removals_integration/issues/134"},"comments":{"href":"https://api.github.com/repos/UKHomeOffice/removals_integration/issues/134/comments"},"review_comments":{"href":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/134/comments"},"review_comment":{"href":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UKHomeOffice/removals_integration/pulls/134/commits"},"statuses":{"href":"https://api.github.com/repos/UKHomeOffice/removals_integration/statuses/8e993e1527611f3a0dea531cb730fe48a369a23c"}}}}