{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/publishing-api/pulls/comments/82623342","pull_request_review_id":3517813,"id":82623342,"diff_hunk":"@@ -2,12 +2,12 @@ module Queries\n   class GetWebContentItems\n     extend ArelHelpers\n \n-    def self.call(content_item_ids)\n+    def self.call(content_item_ids, presenter = WebContentItem)\n       content_items = table(:content_items)\n       filtered = scope\n         .where(content_items[:id].in(content_item_ids))\n       get_rows(filtered).map do |row|\n-        WebContentItem.from_hash(row)\n+        presenter.from_hash(row)","path":"app/queries/get_web_content_items.rb","position":11,"original_position":11,"commit_id":"3c2eda8a92d70da0eedd8045c864e21965c54d9b","original_commit_id":"3c2eda8a92d70da0eedd8045c864e21965c54d9b","user":{"login":"boffbowsh","id":18276,"avatar_url":"https://avatars.githubusercontent.com/u/18276?v=3","gravatar_id":"","url":"https://api.github.com/users/boffbowsh","html_url":"https://github.com/boffbowsh","followers_url":"https://api.github.com/users/boffbowsh/followers","following_url":"https://api.github.com/users/boffbowsh/following{/other_user}","gists_url":"https://api.github.com/users/boffbowsh/gists{/gist_id}","starred_url":"https://api.github.com/users/boffbowsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boffbowsh/subscriptions","organizations_url":"https://api.github.com/users/boffbowsh/orgs","repos_url":"https://api.github.com/users/boffbowsh/repos","events_url":"https://api.github.com/users/boffbowsh/events{/privacy}","received_events_url":"https://api.github.com/users/boffbowsh/received_events","type":"User","site_admin":false},"body":"👏 ","created_at":"2016-10-10T15:10:27Z","updated_at":"2016-10-10T15:12:53Z","html_url":"https://github.com/alphagov/publishing-api/pull/550#discussion_r82623342","pull_request_url":"https://api.github.com/repos/alphagov/publishing-api/pulls/550","_links":{"self":{"href":"https://api.github.com/repos/alphagov/publishing-api/pulls/comments/82623342"},"html":{"href":"https://github.com/alphagov/publishing-api/pull/550#discussion_r82623342"},"pull_request":{"href":"https://api.github.com/repos/alphagov/publishing-api/pulls/550"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/publishing-api/pulls/550","id":88677604,"html_url":"https://github.com/alphagov/publishing-api/pull/550","diff_url":"https://github.com/alphagov/publishing-api/pull/550.diff","patch_url":"https://github.com/alphagov/publishing-api/pull/550.patch","issue_url":"https://api.github.com/repos/alphagov/publishing-api/issues/550","number":550,"state":"open","locked":false,"title":"Replace linkables with query","user":{"login":"dougdroper","id":288481,"avatar_url":"https://avatars.githubusercontent.com/u/288481?v=3","gravatar_id":"","url":"https://api.github.com/users/dougdroper","html_url":"https://github.com/dougdroper","followers_url":"https://api.github.com/users/dougdroper/followers","following_url":"https://api.github.com/users/dougdroper/following{/other_user}","gists_url":"https://api.github.com/users/dougdroper/gists{/gist_id}","starred_url":"https://api.github.com/users/dougdroper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougdroper/subscriptions","organizations_url":"https://api.github.com/users/dougdroper/orgs","repos_url":"https://api.github.com/users/dougdroper/repos","events_url":"https://api.github.com/users/dougdroper/events{/privacy}","received_events_url":"https://api.github.com/users/dougdroper/received_events","type":"User","site_admin":false},"body":"Linkables have proven to be difficult to keep in sync with changes to\r\nstate in the system. This removes the code to create and update them and\r\nuses a query to retrieve the same information.\r\n\r\nAlthough not as fast as linkables, this removes the complication in\r\nattempting to keep the Linkables table up to date. Since it is not as\r\nfast as linkables, we cache the response.\r\n\r\nold\r\ntopic\r\n..........  0.060000   0.010000   0.070000 (  0.169602)\r\nqueries: 12\r\n\r\norganisation\r\n..........  0.090000   0.010000   0.100000 (  0.149797)\r\nqueries: 10\r\n\r\nmainstream_browse_page\r\n..........  0.030000   0.000000   0.030000 (  0.062847)\r\nqueries: 10\r\n\r\npolicy\r\n..........  0.040000   0.010000   0.050000 (  0.159913)\r\nqueries: 10\r\n\r\ntaxon\r\n..........  0.030000   0.000000   0.030000 (  0.034028)\r\nqueries: 10\r\n\r\nnew (warm cache)\r\ntopic\r\n..........  0.580000   0.020000   0.600000 (  0.668640)\r\nqueries: 10\r\n\r\norganisation\r\n..........  0.740000   0.020000   0.760000 (  0.845793)\r\nqueries: 10\r\n\r\nmainstream_browse_page\r\n..........  0.530000   0.010000   0.540000 (  0.611256)\r\nqueries: 10\r\n\r\npolicy\r\n..........  0.190000   0.010000   0.200000 (  0.230594)\r\nqueries: 10\r\n\r\ntaxon\r\n..........  0.050000   0.010000   0.060000 (  0.069919)\r\nqueries: 10","created_at":"2016-10-10T14:56:38Z","updated_at":"2016-10-10T15:12:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f8029a4410b9cb0c7d6f964eb93c21b1c0a4224","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/publishing-api/pulls/550/commits","review_comments_url":"https://api.github.com/repos/alphagov/publishing-api/pulls/550/comments","review_comment_url":"https://api.github.com/repos/alphagov/publishing-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/publishing-api/issues/550/comments","statuses_url":"https://api.github.com/repos/alphagov/publishing-api/statuses/3c2eda8a92d70da0eedd8045c864e21965c54d9b","head":{"label":"alphagov:linkables","ref":"linkables","sha":"3c2eda8a92d70da0eedd8045c864e21965c54d9b","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","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":27546098,"name":"publishing-api","full_name":"alphagov/publishing-api","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","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/publishing-api","description":"Central store for all content on GOV.UK.","fork":false,"url":"https://api.github.com/repos/alphagov/publishing-api","forks_url":"https://api.github.com/repos/alphagov/publishing-api/forks","keys_url":"https://api.github.com/repos/alphagov/publishing-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/publishing-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/publishing-api/teams","hooks_url":"https://api.github.com/repos/alphagov/publishing-api/hooks","issue_events_url":"https://api.github.com/repos/alphagov/publishing-api/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/publishing-api/events","assignees_url":"https://api.github.com/repos/alphagov/publishing-api/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/publishing-api/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/publishing-api/tags","blobs_url":"https://api.github.com/repos/alphagov/publishing-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/publishing-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/publishing-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/publishing-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/publishing-api/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/publishing-api/languages","stargazers_url":"https://api.github.com/repos/alphagov/publishing-api/stargazers","contributors_url":"https://api.github.com/repos/alphagov/publishing-api/contributors","subscribers_url":"https://api.github.com/repos/alphagov/publishing-api/subscribers","subscription_url":"https://api.github.com/repos/alphagov/publishing-api/subscription","commits_url":"https://api.github.com/repos/alphagov/publishing-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/publishing-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/publishing-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/publishing-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/publishing-api/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/publishing-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/publishing-api/merges","archive_url":"https://api.github.com/repos/alphagov/publishing-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/publishing-api/downloads","issues_url":"https://api.github.com/repos/alphagov/publishing-api/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/publishing-api/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/publishing-api/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/publishing-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/publishing-api/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/publishing-api/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/publishing-api/deployments","created_at":"2014-12-04T15:15:43Z","updated_at":"2016-05-25T22:58:45Z","pushed_at":"2016-10-10T15:09:00Z","git_url":"git://github.com/alphagov/publishing-api.git","ssh_url":"git@github.com:alphagov/publishing-api.git","clone_url":"https://github.com/alphagov/publishing-api.git","svn_url":"https://github.com/alphagov/publishing-api","homepage":"","size":2892,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":7,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"8b2c8565b86e5d78a70637db22095f4559ed7923","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","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":27546098,"name":"publishing-api","full_name":"alphagov/publishing-api","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","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/publishing-api","description":"Central store for all content on GOV.UK.","fork":false,"url":"https://api.github.com/repos/alphagov/publishing-api","forks_url":"https://api.github.com/repos/alphagov/publishing-api/forks","keys_url":"https://api.github.com/repos/alphagov/publishing-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/publishing-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/publishing-api/teams","hooks_url":"https://api.github.com/repos/alphagov/publishing-api/hooks","issue_events_url":"https://api.github.com/repos/alphagov/publishing-api/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/publishing-api/events","assignees_url":"https://api.github.com/repos/alphagov/publishing-api/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/publishing-api/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/publishing-api/tags","blobs_url":"https://api.github.com/repos/alphagov/publishing-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/publishing-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/publishing-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/publishing-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/publishing-api/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/publishing-api/languages","stargazers_url":"https://api.github.com/repos/alphagov/publishing-api/stargazers","contributors_url":"https://api.github.com/repos/alphagov/publishing-api/contributors","subscribers_url":"https://api.github.com/repos/alphagov/publishing-api/subscribers","subscription_url":"https://api.github.com/repos/alphagov/publishing-api/subscription","commits_url":"https://api.github.com/repos/alphagov/publishing-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/publishing-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/publishing-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/publishing-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/publishing-api/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/publishing-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/publishing-api/merges","archive_url":"https://api.github.com/repos/alphagov/publishing-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/publishing-api/downloads","issues_url":"https://api.github.com/repos/alphagov/publishing-api/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/publishing-api/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/publishing-api/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/publishing-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/publishing-api/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/publishing-api/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/publishing-api/deployments","created_at":"2014-12-04T15:15:43Z","updated_at":"2016-05-25T22:58:45Z","pushed_at":"2016-10-10T15:09:00Z","git_url":"git://github.com/alphagov/publishing-api.git","ssh_url":"git@github.com:alphagov/publishing-api.git","clone_url":"https://github.com/alphagov/publishing-api.git","svn_url":"https://github.com/alphagov/publishing-api","homepage":"","size":2892,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/publishing-api/pulls/550"},"html":{"href":"https://github.com/alphagov/publishing-api/pull/550"},"issue":{"href":"https://api.github.com/repos/alphagov/publishing-api/issues/550"},"comments":{"href":"https://api.github.com/repos/alphagov/publishing-api/issues/550/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/publishing-api/pulls/550/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/publishing-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/publishing-api/pulls/550/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/publishing-api/statuses/3c2eda8a92d70da0eedd8045c864e21965c54d9b"}}}}
{"actor":{"display_login":"boffbowsh"}}