{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/whitehall/pulls/comments/101501533","pull_request_review_id":22231202,"id":101501533,"diff_hunk":"@@ -0,0 +1,10 @@\n+#Fix the interested editions and add MOD to them\n+edition_ids = [421608, 421659, 421662, 421675, 421676, 421679, 423612, 464978]\n+\n+mod_organisation_id = 17\n+mod = Organisation.find(mod_organisation_id)\n+\n+editions = Edition.find(edition_ids).each{|e| e.organisations << mod}\n+editions.map(&:document_id).each do |document_id|\n+  PublishingApiDocumentRepublishingWorker.new.perform(attachment.attachable.document.id)","path":"db/data_migration/20170207113434_fix_html_attachments_nil_organisations.rb","position":9,"original_position":9,"commit_id":"2d566cfbdb5ca397711ceaaf1c93a2a4a8b22e31","original_commit_id":"2d566cfbdb5ca397711ceaaf1c93a2a4a8b22e31","user":{"login":"gpeng","id":5216,"avatar_url":"https://avatars.githubusercontent.com/u/5216?v=3","gravatar_id":"","url":"https://api.github.com/users/gpeng","html_url":"https://github.com/gpeng","followers_url":"https://api.github.com/users/gpeng/followers","following_url":"https://api.github.com/users/gpeng/following{/other_user}","gists_url":"https://api.github.com/users/gpeng/gists{/gist_id}","starred_url":"https://api.github.com/users/gpeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpeng/subscriptions","organizations_url":"https://api.github.com/users/gpeng/orgs","repos_url":"https://api.github.com/users/gpeng/repos","events_url":"https://api.github.com/users/gpeng/events{/privacy}","received_events_url":"https://api.github.com/users/gpeng/received_events","type":"User","site_admin":false},"body":"Probably best to use `PublishingApiDocumentRepublishingWorker.perform_async` here.","created_at":"2017-02-16T11:52:09Z","updated_at":"2017-02-16T11:52:14Z","html_url":"https://github.com/alphagov/whitehall/pull/3016#discussion_r101501533","pull_request_url":"https://api.github.com/repos/alphagov/whitehall/pulls/3016","_links":{"self":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/comments/101501533"},"html":{"href":"https://github.com/alphagov/whitehall/pull/3016#discussion_r101501533"},"pull_request":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/3016"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/whitehall/pulls/3016","id":104989608,"html_url":"https://github.com/alphagov/whitehall/pull/3016","diff_url":"https://github.com/alphagov/whitehall/pull/3016.diff","patch_url":"https://github.com/alphagov/whitehall/pull/3016.patch","issue_url":"https://api.github.com/repos/alphagov/whitehall/issues/3016","number":3016,"state":"open","locked":false,"title":"Fix nil organisations for HtmlPublicationPresenter","user":{"login":"mgrassotti","id":6908677,"avatar_url":"https://avatars.githubusercontent.com/u/6908677?v=3","gravatar_id":"","url":"https://api.github.com/users/mgrassotti","html_url":"https://github.com/mgrassotti","followers_url":"https://api.github.com/users/mgrassotti/followers","following_url":"https://api.github.com/users/mgrassotti/following{/other_user}","gists_url":"https://api.github.com/users/mgrassotti/gists{/gist_id}","starred_url":"https://api.github.com/users/mgrassotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgrassotti/subscriptions","organizations_url":"https://api.github.com/users/mgrassotti/orgs","repos_url":"https://api.github.com/users/mgrassotti/repos","events_url":"https://api.github.com/users/mgrassotti/events{/privacy}","received_events_url":"https://api.github.com/users/mgrassotti/received_events","type":"User","site_admin":false},"body":"Trello: https://trello.com/c/dMbLwfHJ/585-fix-bug-with-html-pub-having-no-organisation-2\r\n\r\nSome HtmlPublication were provoking an error on government frontend due to nil organisations for the attachment attachable.\r\n\r\nWe are fixing this adding an organisation to the attachable which\r\nhas no one, selecting it from the previous editions.","created_at":"2017-02-07T11:52:13Z","updated_at":"2017-02-16T11:52:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e93563a151f8248be17abf7aecf0d781686d43a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/whitehall/pulls/3016/commits","review_comments_url":"https://api.github.com/repos/alphagov/whitehall/pulls/3016/comments","review_comment_url":"https://api.github.com/repos/alphagov/whitehall/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/whitehall/issues/3016/comments","statuses_url":"https://api.github.com/repos/alphagov/whitehall/statuses/2d566cfbdb5ca397711ceaaf1c93a2a4a8b22e31","head":{"label":"alphagov:fix-nil-organisations","ref":"fix-nil-organisations","sha":"2d566cfbdb5ca397711ceaaf1c93a2a4a8b22e31","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":2416064,"name":"whitehall","full_name":"alphagov/whitehall","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/whitehall","description":"Rails application that publishes and renders most pages on www.gov.uk/government","fork":false,"url":"https://api.github.com/repos/alphagov/whitehall","forks_url":"https://api.github.com/repos/alphagov/whitehall/forks","keys_url":"https://api.github.com/repos/alphagov/whitehall/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/whitehall/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/whitehall/teams","hooks_url":"https://api.github.com/repos/alphagov/whitehall/hooks","issue_events_url":"https://api.github.com/repos/alphagov/whitehall/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/whitehall/events","assignees_url":"https://api.github.com/repos/alphagov/whitehall/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/whitehall/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/whitehall/tags","blobs_url":"https://api.github.com/repos/alphagov/whitehall/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/whitehall/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/whitehall/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/whitehall/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/whitehall/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/whitehall/languages","stargazers_url":"https://api.github.com/repos/alphagov/whitehall/stargazers","contributors_url":"https://api.github.com/repos/alphagov/whitehall/contributors","subscribers_url":"https://api.github.com/repos/alphagov/whitehall/subscribers","subscription_url":"https://api.github.com/repos/alphagov/whitehall/subscription","commits_url":"https://api.github.com/repos/alphagov/whitehall/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/whitehall/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/whitehall/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/whitehall/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/whitehall/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/whitehall/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/whitehall/merges","archive_url":"https://api.github.com/repos/alphagov/whitehall/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/whitehall/downloads","issues_url":"https://api.github.com/repos/alphagov/whitehall/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/whitehall/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/whitehall/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/whitehall/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/whitehall/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/whitehall/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/whitehall/deployments","created_at":"2011-09-19T15:10:49Z","updated_at":"2017-02-15T04:15:12Z","pushed_at":"2017-02-16T11:17:06Z","git_url":"git://github.com/alphagov/whitehall.git","ssh_url":"git@github.com:alphagov/whitehall.git","clone_url":"https://github.com/alphagov/whitehall.git","svn_url":"https://github.com/alphagov/whitehall","homepage":"","size":150424,"stargazers_count":388,"watchers_count":388,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":150,"mirror_url":null,"open_issues_count":14,"forks":150,"open_issues":14,"watchers":388,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"d8ed83d541b187875fee5eac9fa74d21ecde78a2","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":2416064,"name":"whitehall","full_name":"alphagov/whitehall","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/whitehall","description":"Rails application that publishes and renders most pages on www.gov.uk/government","fork":false,"url":"https://api.github.com/repos/alphagov/whitehall","forks_url":"https://api.github.com/repos/alphagov/whitehall/forks","keys_url":"https://api.github.com/repos/alphagov/whitehall/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/whitehall/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/whitehall/teams","hooks_url":"https://api.github.com/repos/alphagov/whitehall/hooks","issue_events_url":"https://api.github.com/repos/alphagov/whitehall/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/whitehall/events","assignees_url":"https://api.github.com/repos/alphagov/whitehall/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/whitehall/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/whitehall/tags","blobs_url":"https://api.github.com/repos/alphagov/whitehall/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/whitehall/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/whitehall/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/whitehall/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/whitehall/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/whitehall/languages","stargazers_url":"https://api.github.com/repos/alphagov/whitehall/stargazers","contributors_url":"https://api.github.com/repos/alphagov/whitehall/contributors","subscribers_url":"https://api.github.com/repos/alphagov/whitehall/subscribers","subscription_url":"https://api.github.com/repos/alphagov/whitehall/subscription","commits_url":"https://api.github.com/repos/alphagov/whitehall/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/whitehall/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/whitehall/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/whitehall/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/whitehall/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/whitehall/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/whitehall/merges","archive_url":"https://api.github.com/repos/alphagov/whitehall/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/whitehall/downloads","issues_url":"https://api.github.com/repos/alphagov/whitehall/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/whitehall/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/whitehall/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/whitehall/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/whitehall/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/whitehall/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/whitehall/deployments","created_at":"2011-09-19T15:10:49Z","updated_at":"2017-02-15T04:15:12Z","pushed_at":"2017-02-16T11:17:06Z","git_url":"git://github.com/alphagov/whitehall.git","ssh_url":"git@github.com:alphagov/whitehall.git","clone_url":"https://github.com/alphagov/whitehall.git","svn_url":"https://github.com/alphagov/whitehall","homepage":"","size":150424,"stargazers_count":388,"watchers_count":388,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":150,"mirror_url":null,"open_issues_count":14,"forks":150,"open_issues":14,"watchers":388,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/3016"},"html":{"href":"https://github.com/alphagov/whitehall/pull/3016"},"issue":{"href":"https://api.github.com/repos/alphagov/whitehall/issues/3016"},"comments":{"href":"https://api.github.com/repos/alphagov/whitehall/issues/3016/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/3016/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/whitehall/pulls/3016/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/whitehall/statuses/2d566cfbdb5ca397711ceaaf1c93a2a4a8b22e31"}}}}
{"actor":{"display_login":"gpeng"}}