{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/publisher/pulls/comments/195387429","pull_request_review_id":128745361,"id":195387429,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTM4NzQyOQ==","diff_hunk":"@@ -165,16 +156,12 @@ def any_editions_ever_published?\n   end\n \n   def update_editions\n-    case state\n-    when 'draft'\n-      if self.slug_changed?\n-        Edition.where(:state.nin => [\"archived\"],\n-                      panopticon_id: self.id).each do |edition| # rubocop:disable Rails/FindEach\n-          edition.update_slug_from_artefact(self)\n-        end\n-      end\n-    when 'archived'\n+    if state == 'archived'\n       archive_editions\n+    elsif self.slug_changed?\n+      Edition.draft_in_publishing_api.where(panopticon_id: self.id).each do |edition| # rubocop:disable Rails/FindEach","path":"app/models/artefact.rb","position":39,"original_position":39,"commit_id":"d4ffc164f63acc2b45f98a02b56ed0fc615a242d","original_commit_id":"d4ffc164f63acc2b45f98a02b56ed0fc615a242d","user":{"login":"barrucadu","id":75235,"node_id":"MDQ6VXNlcjc1MjM1","avatar_url":"https://avatars0.githubusercontent.com/u/75235?v=4","gravatar_id":"","url":"https://api.github.com/users/barrucadu","html_url":"https://github.com/barrucadu","followers_url":"https://api.github.com/users/barrucadu/followers","following_url":"https://api.github.com/users/barrucadu/following{/other_user}","gists_url":"https://api.github.com/users/barrucadu/gists{/gist_id}","starred_url":"https://api.github.com/users/barrucadu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barrucadu/subscriptions","organizations_url":"https://api.github.com/users/barrucadu/orgs","repos_url":"https://api.github.com/users/barrucadu/repos","events_url":"https://api.github.com/users/barrucadu/events{/privacy}","received_events_url":"https://api.github.com/users/barrucadu/received_events","type":"User","site_admin":false},"body":"Not sure - on either point.  I just kept this logic as close to the original as I could.","created_at":"2018-06-14T11:27:19Z","updated_at":"2018-06-14T11:27:19Z","html_url":"https://github.com/alphagov/publisher/pull/880#discussion_r195387429","pull_request_url":"https://api.github.com/repos/alphagov/publisher/pulls/880","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/alphagov/publisher/pulls/comments/195387429"},"html":{"href":"https://github.com/alphagov/publisher/pull/880#discussion_r195387429"},"pull_request":{"href":"https://api.github.com/repos/alphagov/publisher/pulls/880"}},"in_reply_to_id":195386128},"pull_request":{"url":"https://api.github.com/repos/alphagov/publisher/pulls/880","id":194628646,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0NjI4NjQ2","html_url":"https://github.com/alphagov/publisher/pull/880","diff_url":"https://github.com/alphagov/publisher/pull/880.diff","patch_url":"https://github.com/alphagov/publisher/pull/880.patch","issue_url":"https://api.github.com/repos/alphagov/publisher/issues/880","number":880,"state":"open","locked":false,"title":"[WIP] Allow editing artefact slugs","user":{"login":"barrucadu","id":75235,"node_id":"MDQ6VXNlcjc1MjM1","avatar_url":"https://avatars0.githubusercontent.com/u/75235?v=4","gravatar_id":"","url":"https://api.github.com/users/barrucadu","html_url":"https://github.com/barrucadu","followers_url":"https://api.github.com/users/barrucadu/followers","following_url":"https://api.github.com/users/barrucadu/following{/other_user}","gists_url":"https://api.github.com/users/barrucadu/gists{/gist_id}","starred_url":"https://api.github.com/users/barrucadu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barrucadu/subscriptions","organizations_url":"https://api.github.com/users/barrucadu/orgs","repos_url":"https://api.github.com/users/barrucadu/repos","events_url":"https://api.github.com/users/barrucadu/events{/privacy}","received_events_url":"https://api.github.com/users/barrucadu/received_events","type":"User","site_admin":false},"body":"This restriction on editing slugs comes from https://github.com/alphagov/govuk_content_models/commit/2f82275027300fc78924f5227ae1dce6fb3e0a5c, copied into this repository when that was retired, and the original commit message from 2012 justifies the change by reference to Panopticon, which has since been retired.\r\n\r\nI tried it on integration, and it seemed to work with a guide, even the subpages.  I suspect there's no reason to keep the restriction any more.\r\n\r\nThis will allow publishers to self-serve on slug changes in publisher from now on.\r\n\r\n---\r\n\r\nRelated to this [Trello card](https://trello.com/c/6ZHEUpB9/228-change-slug-of-uk-residence-for-eu-citizens-guide)","created_at":"2018-06-13T15:33:32Z","updated_at":"2018-06-14T11:27:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50b44e651ed91b4314b9ca59d2355e6ff29c300d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/publisher/pulls/880/commits","review_comments_url":"https://api.github.com/repos/alphagov/publisher/pulls/880/comments","review_comment_url":"https://api.github.com/repos/alphagov/publisher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/publisher/issues/880/comments","statuses_url":"https://api.github.com/repos/alphagov/publisher/statuses/d4ffc164f63acc2b45f98a02b56ed0fc615a242d","head":{"label":"alphagov:msw-slug","ref":"msw-slug","sha":"d4ffc164f63acc2b45f98a02b56ed0fc615a242d","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":1996077,"node_id":"MDEwOlJlcG9zaXRvcnkxOTk2MDc3","name":"publisher","full_name":"alphagov/publisher","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/publisher","description":"Publishes mainstream content on GOV.UK","fork":false,"url":"https://api.github.com/repos/alphagov/publisher","forks_url":"https://api.github.com/repos/alphagov/publisher/forks","keys_url":"https://api.github.com/repos/alphagov/publisher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/publisher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/publisher/teams","hooks_url":"https://api.github.com/repos/alphagov/publisher/hooks","issue_events_url":"https://api.github.com/repos/alphagov/publisher/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/publisher/events","assignees_url":"https://api.github.com/repos/alphagov/publisher/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/publisher/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/publisher/tags","blobs_url":"https://api.github.com/repos/alphagov/publisher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/publisher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/publisher/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/publisher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/publisher/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/publisher/languages","stargazers_url":"https://api.github.com/repos/alphagov/publisher/stargazers","contributors_url":"https://api.github.com/repos/alphagov/publisher/contributors","subscribers_url":"https://api.github.com/repos/alphagov/publisher/subscribers","subscription_url":"https://api.github.com/repos/alphagov/publisher/subscription","commits_url":"https://api.github.com/repos/alphagov/publisher/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/publisher/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/publisher/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/publisher/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/publisher/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/publisher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/publisher/merges","archive_url":"https://api.github.com/repos/alphagov/publisher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/publisher/downloads","issues_url":"https://api.github.com/repos/alphagov/publisher/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/publisher/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/publisher/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/publisher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/publisher/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/publisher/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/publisher/deployments","created_at":"2011-07-04T15:35:13Z","updated_at":"2018-06-13T14:38:18Z","pushed_at":"2018-06-14T11:04:38Z","git_url":"git://github.com/alphagov/publisher.git","ssh_url":"git@github.com:alphagov/publisher.git","clone_url":"https://github.com/alphagov/publisher.git","svn_url":"https://github.com/alphagov/publisher","homepage":"https://docs.publishing.service.gov.uk/apps/publisher.html","size":8223,"stargazers_count":32,"watchers_count":32,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":32,"open_issues":3,"watchers":32,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"3707b29108f9bf27754c83b75c5eef32732ab88b","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":1996077,"node_id":"MDEwOlJlcG9zaXRvcnkxOTk2MDc3","name":"publisher","full_name":"alphagov/publisher","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/publisher","description":"Publishes mainstream content on GOV.UK","fork":false,"url":"https://api.github.com/repos/alphagov/publisher","forks_url":"https://api.github.com/repos/alphagov/publisher/forks","keys_url":"https://api.github.com/repos/alphagov/publisher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/publisher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/publisher/teams","hooks_url":"https://api.github.com/repos/alphagov/publisher/hooks","issue_events_url":"https://api.github.com/repos/alphagov/publisher/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/publisher/events","assignees_url":"https://api.github.com/repos/alphagov/publisher/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/publisher/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/publisher/tags","blobs_url":"https://api.github.com/repos/alphagov/publisher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/publisher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/publisher/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/publisher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/publisher/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/publisher/languages","stargazers_url":"https://api.github.com/repos/alphagov/publisher/stargazers","contributors_url":"https://api.github.com/repos/alphagov/publisher/contributors","subscribers_url":"https://api.github.com/repos/alphagov/publisher/subscribers","subscription_url":"https://api.github.com/repos/alphagov/publisher/subscription","commits_url":"https://api.github.com/repos/alphagov/publisher/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/publisher/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/publisher/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/publisher/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/publisher/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/publisher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/publisher/merges","archive_url":"https://api.github.com/repos/alphagov/publisher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/publisher/downloads","issues_url":"https://api.github.com/repos/alphagov/publisher/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/publisher/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/publisher/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/publisher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/publisher/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/publisher/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/publisher/deployments","created_at":"2011-07-04T15:35:13Z","updated_at":"2018-06-13T14:38:18Z","pushed_at":"2018-06-14T11:04:38Z","git_url":"git://github.com/alphagov/publisher.git","ssh_url":"git@github.com:alphagov/publisher.git","clone_url":"https://github.com/alphagov/publisher.git","svn_url":"https://github.com/alphagov/publisher","homepage":"https://docs.publishing.service.gov.uk/apps/publisher.html","size":8223,"stargazers_count":32,"watchers_count":32,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":32,"open_issues":3,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/publisher/pulls/880"},"html":{"href":"https://github.com/alphagov/publisher/pull/880"},"issue":{"href":"https://api.github.com/repos/alphagov/publisher/issues/880"},"comments":{"href":"https://api.github.com/repos/alphagov/publisher/issues/880/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/publisher/pulls/880/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/publisher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/publisher/pulls/880/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/publisher/statuses/d4ffc164f63acc2b45f98a02b56ed0fc615a242d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"barrucadu"}}