{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/short-url-manager/pulls/comments/23542883","id":23542883,"diff_hunk":"@@ -49,6 +51,21 @@ def reject\n     redirect_to short_url_requests_path\n   end\n \n+  def destroy\n+    router.delete_route(\"#{@short_url_request.from_path}\")\n+    if router.commit_routes\n+      @short_url_request.destroy","path":"app/controllers/short_url_requests_controller.rb","position":18,"original_position":18,"commit_id":"7d7746fd49cfbb24b79c104f58555abdc7481931","original_commit_id":"7d7746fd49cfbb24b79c104f58555abdc7481931","user":{"login":"alext","id":5560,"avatar_url":"https://avatars.githubusercontent.com/u/5560?v=3","gravatar_id":"","url":"https://api.github.com/users/alext","html_url":"https://github.com/alext","followers_url":"https://api.github.com/users/alext/followers","following_url":"https://api.github.com/users/alext/following{/other_user}","gists_url":"https://api.github.com/users/alext/gists{/gist_id}","starred_url":"https://api.github.com/users/alext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alext/subscriptions","organizations_url":"https://api.github.com/users/alext/orgs","repos_url":"https://api.github.com/users/alext/repos","events_url":"https://api.github.com/users/alext/events{/privacy}","received_events_url":"https://api.github.com/users/alext/received_events","type":"User","site_admin":false},"body":"That sounds like a reasonable thing to do (as long as the state is clear).","created_at":"2015-01-26T16:32:26Z","updated_at":"2015-01-26T16:32:26Z","html_url":"https://github.com/alphagov/short-url-manager/pull/21#discussion_r23542883","pull_request_url":"https://api.github.com/repos/alphagov/short-url-manager/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/alphagov/short-url-manager/pulls/comments/23542883"},"html":{"href":"https://github.com/alphagov/short-url-manager/pull/21#discussion_r23542883"},"pull_request":{"href":"https://api.github.com/repos/alphagov/short-url-manager/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/short-url-manager/pulls/21","id":27364962,"html_url":"https://github.com/alphagov/short-url-manager/pull/21","diff_url":"https://github.com/alphagov/short-url-manager/pull/21.diff","patch_url":"https://github.com/alphagov/short-url-manager/pull/21.patch","issue_url":"https://api.github.com/repos/alphagov/short-url-manager/issues/21","number":21,"state":"open","locked":false,"title":"For each of the links on the list page, add a delete button","user":{"login":"issyl0","id":355033,"avatar_url":"https://avatars.githubusercontent.com/u/355033?v=3","gravatar_id":"","url":"https://api.github.com/users/issyl0","html_url":"https://github.com/issyl0","followers_url":"https://api.github.com/users/issyl0/followers","following_url":"https://api.github.com/users/issyl0/following{/other_user}","gists_url":"https://api.github.com/users/issyl0/gists{/gist_id}","starred_url":"https://api.github.com/users/issyl0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issyl0/subscriptions","organizations_url":"https://api.github.com/users/issyl0/orgs","repos_url":"https://api.github.com/users/issyl0/repos","events_url":"https://api.github.com/users/issyl0/events{/privacy}","received_events_url":"https://api.github.com/users/issyl0/received_events","type":"User","site_admin":false},"body":"- Add the delete button to the show page in place of the accept or\r\n  reject buttons, for all redirects except those in 'pending' state.\r\n- Remove the redirect from the router. If this succeeds, remove it from\r\n  this app's database.\r\n- Make a `router` method so we use the same router object everytime,\r\n  and it's easier to test. Test the `destroy` method in the\r\n  ShortUrlRequestsControllerSpec, with some stubbing and mocking for the\r\n  Router part - thanks to Russell Garner for the help.\r\n\r\n:fire:","created_at":"2015-01-14T16:59:17Z","updated_at":"2015-01-26T16:32:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"265596ab88e68d7cd7a78f108efff3a098760a77","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/short-url-manager/pulls/21/commits","review_comments_url":"https://api.github.com/repos/alphagov/short-url-manager/pulls/21/comments","review_comment_url":"https://api.github.com/repos/alphagov/short-url-manager/pulls/comments/{number}","comments_url":"https://api.github.com/repos/alphagov/short-url-manager/issues/21/comments","statuses_url":"https://api.github.com/repos/alphagov/short-url-manager/statuses/7d7746fd49cfbb24b79c104f58555abdc7481931","head":{"label":"alphagov:removable_redirects","ref":"removable_redirects","sha":"7d7746fd49cfbb24b79c104f58555abdc7481931","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":21617899,"name":"short-url-manager","full_name":"alphagov/short-url-manager","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/short-url-manager","description":"Publishing tool to request, approve and create short URL redirects on GOV.UK","fork":false,"url":"https://api.github.com/repos/alphagov/short-url-manager","forks_url":"https://api.github.com/repos/alphagov/short-url-manager/forks","keys_url":"https://api.github.com/repos/alphagov/short-url-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/short-url-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/short-url-manager/teams","hooks_url":"https://api.github.com/repos/alphagov/short-url-manager/hooks","issue_events_url":"https://api.github.com/repos/alphagov/short-url-manager/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/short-url-manager/events","assignees_url":"https://api.github.com/repos/alphagov/short-url-manager/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/short-url-manager/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/short-url-manager/tags","blobs_url":"https://api.github.com/repos/alphagov/short-url-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/short-url-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/short-url-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/short-url-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/short-url-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/short-url-manager/languages","stargazers_url":"https://api.github.com/repos/alphagov/short-url-manager/stargazers","contributors_url":"https://api.github.com/repos/alphagov/short-url-manager/contributors","subscribers_url":"https://api.github.com/repos/alphagov/short-url-manager/subscribers","subscription_url":"https://api.github.com/repos/alphagov/short-url-manager/subscription","commits_url":"https://api.github.com/repos/alphagov/short-url-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/short-url-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/short-url-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/short-url-manager/issues/comments/{number}","contents_url":"https://api.github.com/repos/alphagov/short-url-manager/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/short-url-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/short-url-manager/merges","archive_url":"https://api.github.com/repos/alphagov/short-url-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/short-url-manager/downloads","issues_url":"https://api.github.com/repos/alphagov/short-url-manager/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/short-url-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/short-url-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/short-url-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/short-url-manager/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/short-url-manager/releases{/id}","created_at":"2014-07-08T15:20:33Z","updated_at":"2015-01-26T15:51:24Z","pushed_at":"2015-01-26T15:53:32Z","git_url":"git://github.com/alphagov/short-url-manager.git","ssh_url":"git@github.com:alphagov/short-url-manager.git","clone_url":"https://github.com/alphagov/short-url-manager.git","svn_url":"https://github.com/alphagov/short-url-manager","homepage":"","size":954,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"6d5750212fcb2ba6d032ceab9e3eb5f39a1ee08a","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":21617899,"name":"short-url-manager","full_name":"alphagov/short-url-manager","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/short-url-manager","description":"Publishing tool to request, approve and create short URL redirects on GOV.UK","fork":false,"url":"https://api.github.com/repos/alphagov/short-url-manager","forks_url":"https://api.github.com/repos/alphagov/short-url-manager/forks","keys_url":"https://api.github.com/repos/alphagov/short-url-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/short-url-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/short-url-manager/teams","hooks_url":"https://api.github.com/repos/alphagov/short-url-manager/hooks","issue_events_url":"https://api.github.com/repos/alphagov/short-url-manager/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/short-url-manager/events","assignees_url":"https://api.github.com/repos/alphagov/short-url-manager/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/short-url-manager/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/short-url-manager/tags","blobs_url":"https://api.github.com/repos/alphagov/short-url-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/short-url-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/short-url-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/short-url-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/short-url-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/short-url-manager/languages","stargazers_url":"https://api.github.com/repos/alphagov/short-url-manager/stargazers","contributors_url":"https://api.github.com/repos/alphagov/short-url-manager/contributors","subscribers_url":"https://api.github.com/repos/alphagov/short-url-manager/subscribers","subscription_url":"https://api.github.com/repos/alphagov/short-url-manager/subscription","commits_url":"https://api.github.com/repos/alphagov/short-url-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/short-url-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/short-url-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/short-url-manager/issues/comments/{number}","contents_url":"https://api.github.com/repos/alphagov/short-url-manager/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/short-url-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/short-url-manager/merges","archive_url":"https://api.github.com/repos/alphagov/short-url-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/short-url-manager/downloads","issues_url":"https://api.github.com/repos/alphagov/short-url-manager/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/short-url-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/short-url-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/short-url-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/short-url-manager/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/short-url-manager/releases{/id}","created_at":"2014-07-08T15:20:33Z","updated_at":"2015-01-26T15:51:24Z","pushed_at":"2015-01-26T15:53:32Z","git_url":"git://github.com/alphagov/short-url-manager.git","ssh_url":"git@github.com:alphagov/short-url-manager.git","clone_url":"https://github.com/alphagov/short-url-manager.git","svn_url":"https://github.com/alphagov/short-url-manager","homepage":"","size":954,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/short-url-manager/pulls/21"},"html":{"href":"https://github.com/alphagov/short-url-manager/pull/21"},"issue":{"href":"https://api.github.com/repos/alphagov/short-url-manager/issues/21"},"comments":{"href":"https://api.github.com/repos/alphagov/short-url-manager/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/short-url-manager/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/short-url-manager/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/alphagov/short-url-manager/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/short-url-manager/statuses/7d7746fd49cfbb24b79c104f58555abdc7481931"}}}}