{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/publishing-api/pulls/comments/47625497","id":47625497,"diff_hunk":"@@ -45,6 +47,26 @@ def create_or_update_draft_content_item!\n       def content_item_attributes\n         payload.slice(*DraftContentItem::TOP_LEVEL_FIELDS)\n       end\n+\n+      def handle_path_change(content_item)\n+        path_change = content_item.previous_changes[:base_path]","path":"app/commands/v2/put_content.rb","position":15,"original_position":15,"commit_id":"0d4664c792f05af2ba1adf70108270c2276a3544","original_commit_id":"0d4664c792f05af2ba1adf70108270c2276a3544","user":{"login":"jamiecobbett","id":93739,"avatar_url":"https://avatars.githubusercontent.com/u/93739?v=3","gravatar_id":"","url":"https://api.github.com/users/jamiecobbett","html_url":"https://github.com/jamiecobbett","followers_url":"https://api.github.com/users/jamiecobbett/followers","following_url":"https://api.github.com/users/jamiecobbett/following{/other_user}","gists_url":"https://api.github.com/users/jamiecobbett/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiecobbett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiecobbett/subscriptions","organizations_url":"https://api.github.com/users/jamiecobbett/orgs","repos_url":"https://api.github.com/users/jamiecobbett/repos","events_url":"https://api.github.com/users/jamiecobbett/events{/privacy}","received_events_url":"https://api.github.com/users/jamiecobbett/received_events","type":"User","site_admin":false},"body":"I'd have been tempted to use destructuring assignment:\r\n`old_path, new_path = content_item.previous_changes[:base_path]`","created_at":"2015-12-15T11:35:15Z","updated_at":"2015-12-15T11:35:15Z","html_url":"https://github.com/alphagov/publishing-api/pull/171#discussion_r47625497","pull_request_url":"https://api.github.com/repos/alphagov/publishing-api/pulls/171","_links":{"self":{"href":"https://api.github.com/repos/alphagov/publishing-api/pulls/comments/47625497"},"html":{"href":"https://github.com/alphagov/publishing-api/pull/171#discussion_r47625497"},"pull_request":{"href":"https://api.github.com/repos/alphagov/publishing-api/pulls/171"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/publishing-api/pulls/171","id":53403322,"html_url":"https://github.com/alphagov/publishing-api/pull/171","diff_url":"https://github.com/alphagov/publishing-api/pull/171.diff","patch_url":"https://github.com/alphagov/publishing-api/pull/171.patch","issue_url":"https://api.github.com/repos/alphagov/publishing-api/issues/171","number":171,"state":"closed","locked":false,"title":"Allow content items to move","user":{"login":"danielroseman","id":131395,"avatar_url":"https://avatars.githubusercontent.com/u/131395?v=3","gravatar_id":"","url":"https://api.github.com/users/danielroseman","html_url":"https://github.com/danielroseman","followers_url":"https://api.github.com/users/danielroseman/followers","following_url":"https://api.github.com/users/danielroseman/following{/other_user}","gists_url":"https://api.github.com/users/danielroseman/gists{/gist_id}","starred_url":"https://api.github.com/users/danielroseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielroseman/subscriptions","organizations_url":"https://api.github.com/users/danielroseman/orgs","repos_url":"https://api.github.com/users/danielroseman/repos","events_url":"https://api.github.com/users/danielroseman/events{/privacy}","received_events_url":"https://api.github.com/users/danielroseman/received_events","type":"User","site_admin":false},"body":"Currently items can't be moved to a new path once they have been published. This change allows them to move, automatically creating a redirect from the old path to the new one.\r\n\r\nUpdating the path of an item that has never been published triggers a delete of the old item from draft content-store.\r\n\r\nhttps://trello.com/c/CoS7IYEh","created_at":"2015-12-11T15:09:32Z","updated_at":"2015-12-15T11:35:15Z","closed_at":"2015-12-15T11:14:29Z","merged_at":"2015-12-15T11:14:29Z","merge_commit_sha":"ebe9ea598b6d0f1bfd9ca5d72ddbfab43fc9fdb4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/publishing-api/pulls/171/commits","review_comments_url":"https://api.github.com/repos/alphagov/publishing-api/pulls/171/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/171/comments","statuses_url":"https://api.github.com/repos/alphagov/publishing-api/statuses/0d4664c792f05af2ba1adf70108270c2276a3544","head":{"label":"alphagov:content-move","ref":"content-move","sha":"0d4664c792f05af2ba1adf70108270c2276a3544","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}","created_at":"2014-12-04T15:15:43Z","updated_at":"2015-12-01T12:07:10Z","pushed_at":"2015-12-15T11:16:42Z","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":1045,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":3,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"2dd3162439cc658e91694baaa0fa26078e1d64d3","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}","created_at":"2014-12-04T15:15:43Z","updated_at":"2015-12-01T12:07:10Z","pushed_at":"2015-12-15T11:16:42Z","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":1045,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/publishing-api/pulls/171"},"html":{"href":"https://github.com/alphagov/publishing-api/pull/171"},"issue":{"href":"https://api.github.com/repos/alphagov/publishing-api/issues/171"},"comments":{"href":"https://api.github.com/repos/alphagov/publishing-api/issues/171/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/publishing-api/pulls/171/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/171/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/publishing-api/statuses/0d4664c792f05af2ba1adf70108270c2276a3544"}}}}