{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/comments/216273477","pull_request_review_id":153714467,"id":216273477,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNjI3MzQ3Nw==","diff_hunk":"@@ -1,7 +1,7 @@\n module Policies\n   class Failed\n     def self.call(scope)\n-      scope.where(content_id: Audit.failing.select(:content_id))\n+      scope.joins(:audit).merge(Audit.failing)","path":"app/domain/policies/failed.rb","position":5,"original_position":5,"commit_id":"94f52a76567f73f1c4c0b91a83c3b44c464e6c5d","original_commit_id":"94f52a76567f73f1c4c0b91a83c3b44c464e6c5d","user":{"login":"thomasleese","id":510498,"node_id":"MDQ6VXNlcjUxMDQ5OA==","avatar_url":"https://avatars2.githubusercontent.com/u/510498?v=4","gravatar_id":"","url":"https://api.github.com/users/thomasleese","html_url":"https://github.com/thomasleese","followers_url":"https://api.github.com/users/thomasleese/followers","following_url":"https://api.github.com/users/thomasleese/following{/other_user}","gists_url":"https://api.github.com/users/thomasleese/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasleese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasleese/subscriptions","organizations_url":"https://api.github.com/users/thomasleese/orgs","repos_url":"https://api.github.com/users/thomasleese/repos","events_url":"https://api.github.com/users/thomasleese/events{/privacy}","received_events_url":"https://api.github.com/users/thomasleese/received_events","type":"User","site_admin":false},"body":"https://github.com/alphagov/content-audit-tool/blob/52825161d79174aa2b6cb16060832f3c1b0144fa/app/models/audit.rb#L6-L7","created_at":"2018-09-10T10:34:00Z","updated_at":"2018-09-10T10:34:00Z","html_url":"https://github.com/alphagov/content-audit-tool/pull/149#discussion_r216273477","pull_request_url":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/149","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/comments/216273477"},"html":{"href":"https://github.com/alphagov/content-audit-tool/pull/149#discussion_r216273477"},"pull_request":{"href":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/149"}},"in_reply_to_id":216272064},"pull_request":{"url":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/149","id":213919273,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzOTE5Mjcz","html_url":"https://github.com/alphagov/content-audit-tool/pull/149","diff_url":"https://github.com/alphagov/content-audit-tool/pull/149.diff","patch_url":"https://github.com/alphagov/content-audit-tool/pull/149.patch","issue_url":"https://api.github.com/repos/alphagov/content-audit-tool/issues/149","number":149,"state":"open","locked":false,"title":"Use joins instead of IN and NOT IN","user":{"login":"thomasleese","id":510498,"node_id":"MDQ6VXNlcjUxMDQ5OA==","avatar_url":"https://avatars2.githubusercontent.com/u/510498?v=4","gravatar_id":"","url":"https://api.github.com/users/thomasleese","html_url":"https://github.com/thomasleese","followers_url":"https://api.github.com/users/thomasleese/followers","following_url":"https://api.github.com/users/thomasleese/following{/other_user}","gists_url":"https://api.github.com/users/thomasleese/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasleese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasleese/subscriptions","organizations_url":"https://api.github.com/users/thomasleese/orgs","repos_url":"https://api.github.com/users/thomasleese/repos","events_url":"https://api.github.com/users/thomasleese/events{/privacy}","received_events_url":"https://api.github.com/users/thomasleese/received_events","type":"User","site_admin":false},"body":"This has significant performance improvements as it avoids having to execute multiple subqueries for each row.\r\n\r\n[Trello Card](https://trello.com/c/VztlS695/447-investigate-options-for-reducing-load-on-the-production-postgres-primary)","created_at":"2018-09-07T12:54:55Z","updated_at":"2018-09-10T10:34:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5d81fac037d35c5db043114df89cd698667b51c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/149/commits","review_comments_url":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/149/comments","review_comment_url":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/content-audit-tool/issues/149/comments","statuses_url":"https://api.github.com/repos/alphagov/content-audit-tool/statuses/94f52a76567f73f1c4c0b91a83c3b44c464e6c5d","head":{"label":"alphagov:use-joins-instead-of-in","ref":"use-joins-instead-of-in","sha":"94f52a76567f73f1c4c0b91a83c3b44c464e6c5d","user":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":118006127,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgwMDYxMjc=","name":"content-audit-tool","full_name":"alphagov/content-audit-tool","owner":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/content-audit-tool","description":null,"fork":false,"url":"https://api.github.com/repos/alphagov/content-audit-tool","forks_url":"https://api.github.com/repos/alphagov/content-audit-tool/forks","keys_url":"https://api.github.com/repos/alphagov/content-audit-tool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/content-audit-tool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/content-audit-tool/teams","hooks_url":"https://api.github.com/repos/alphagov/content-audit-tool/hooks","issue_events_url":"https://api.github.com/repos/alphagov/content-audit-tool/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/content-audit-tool/events","assignees_url":"https://api.github.com/repos/alphagov/content-audit-tool/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/content-audit-tool/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/content-audit-tool/tags","blobs_url":"https://api.github.com/repos/alphagov/content-audit-tool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/content-audit-tool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/content-audit-tool/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/content-audit-tool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/content-audit-tool/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/content-audit-tool/languages","stargazers_url":"https://api.github.com/repos/alphagov/content-audit-tool/stargazers","contributors_url":"https://api.github.com/repos/alphagov/content-audit-tool/contributors","subscribers_url":"https://api.github.com/repos/alphagov/content-audit-tool/subscribers","subscription_url":"https://api.github.com/repos/alphagov/content-audit-tool/subscription","commits_url":"https://api.github.com/repos/alphagov/content-audit-tool/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/content-audit-tool/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/content-audit-tool/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/content-audit-tool/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/content-audit-tool/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/content-audit-tool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/content-audit-tool/merges","archive_url":"https://api.github.com/repos/alphagov/content-audit-tool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/content-audit-tool/downloads","issues_url":"https://api.github.com/repos/alphagov/content-audit-tool/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/content-audit-tool/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/content-audit-tool/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/content-audit-tool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/content-audit-tool/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/content-audit-tool/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/content-audit-tool/deployments","created_at":"2018-01-18T16:10:45Z","updated_at":"2018-09-10T10:19:16Z","pushed_at":"2018-09-10T10:25:14Z","git_url":"git://github.com/alphagov/content-audit-tool.git","ssh_url":"git@github.com:alphagov/content-audit-tool.git","clone_url":"https://github.com/alphagov/content-audit-tool.git","svn_url":"https://github.com/alphagov/content-audit-tool","homepage":"https://docs.publishing.service.gov.uk/apps/content-audit-tool.html","size":2280,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"b154aa55897f815ce6c830576edc8fb66aa6b265","user":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":118006127,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgwMDYxMjc=","name":"content-audit-tool","full_name":"alphagov/content-audit-tool","owner":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/content-audit-tool","description":null,"fork":false,"url":"https://api.github.com/repos/alphagov/content-audit-tool","forks_url":"https://api.github.com/repos/alphagov/content-audit-tool/forks","keys_url":"https://api.github.com/repos/alphagov/content-audit-tool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/content-audit-tool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/content-audit-tool/teams","hooks_url":"https://api.github.com/repos/alphagov/content-audit-tool/hooks","issue_events_url":"https://api.github.com/repos/alphagov/content-audit-tool/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/content-audit-tool/events","assignees_url":"https://api.github.com/repos/alphagov/content-audit-tool/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/content-audit-tool/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/content-audit-tool/tags","blobs_url":"https://api.github.com/repos/alphagov/content-audit-tool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/content-audit-tool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/content-audit-tool/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/content-audit-tool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/content-audit-tool/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/content-audit-tool/languages","stargazers_url":"https://api.github.com/repos/alphagov/content-audit-tool/stargazers","contributors_url":"https://api.github.com/repos/alphagov/content-audit-tool/contributors","subscribers_url":"https://api.github.com/repos/alphagov/content-audit-tool/subscribers","subscription_url":"https://api.github.com/repos/alphagov/content-audit-tool/subscription","commits_url":"https://api.github.com/repos/alphagov/content-audit-tool/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/content-audit-tool/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/content-audit-tool/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/content-audit-tool/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/content-audit-tool/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/content-audit-tool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/content-audit-tool/merges","archive_url":"https://api.github.com/repos/alphagov/content-audit-tool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/content-audit-tool/downloads","issues_url":"https://api.github.com/repos/alphagov/content-audit-tool/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/content-audit-tool/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/content-audit-tool/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/content-audit-tool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/content-audit-tool/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/content-audit-tool/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/content-audit-tool/deployments","created_at":"2018-01-18T16:10:45Z","updated_at":"2018-09-10T10:19:16Z","pushed_at":"2018-09-10T10:25:14Z","git_url":"git://github.com/alphagov/content-audit-tool.git","ssh_url":"git@github.com:alphagov/content-audit-tool.git","clone_url":"https://github.com/alphagov/content-audit-tool.git","svn_url":"https://github.com/alphagov/content-audit-tool","homepage":"https://docs.publishing.service.gov.uk/apps/content-audit-tool.html","size":2280,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/149"},"html":{"href":"https://github.com/alphagov/content-audit-tool/pull/149"},"issue":{"href":"https://api.github.com/repos/alphagov/content-audit-tool/issues/149"},"comments":{"href":"https://api.github.com/repos/alphagov/content-audit-tool/issues/149/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/149/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/content-audit-tool/pulls/149/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/content-audit-tool/statuses/94f52a76567f73f1c4c0b91a83c3b44c464e6c5d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"thomasleese"}}