{"action":"created","comment":{"url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/comments/45884086","id":45884086,"diff_hunk":"@@ -0,0 +1,34 @@\n+class UserOrganisationDecliner\n+\n+  def initialize(listener, user, current_user)\n+    @listener = listener\n+    @user = user\n+    @current_user = current_user\n+  end\n+\n+  def call\n+    error_message_if_not_superadmin\n+    remove_pending_org_from_user\n+  end\n+\n+  attr_reader :listener, :user, :current_user\n+\n+  private\n+\n+  def is_current_user_superadmin?","path":"app/services/user_organisation_decliner.rb","position":18,"original_position":18,"commit_id":"ee0035ee658f5f8b3a36969eb405eb4027a73f30","original_commit_id":"ee0035ee658f5f8b3a36969eb405eb4027a73f30","user":{"login":"mtc2013","id":3909918,"avatar_url":"https://avatars.githubusercontent.com/u/3909918?v=3","gravatar_id":"","url":"https://api.github.com/users/mtc2013","html_url":"https://github.com/mtc2013","followers_url":"https://api.github.com/users/mtc2013/followers","following_url":"https://api.github.com/users/mtc2013/following{/other_user}","gists_url":"https://api.github.com/users/mtc2013/gists{/gist_id}","starred_url":"https://api.github.com/users/mtc2013/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtc2013/subscriptions","organizations_url":"https://api.github.com/users/mtc2013/orgs","repos_url":"https://api.github.com/users/mtc2013/repos","events_url":"https://api.github.com/users/mtc2013/events{/privacy}","received_events_url":"https://api.github.com/users/mtc2013/received_events","type":"User","site_admin":false},"body":"@tansaku actually, since we inject current_user into the new, we don't really need this, I suppose.","created_at":"2015-11-25T16:03:19Z","updated_at":"2015-11-25T16:03:19Z","html_url":"https://github.com/AgileVentures/LocalSupport/pull/196#discussion_r45884086","pull_request_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/196","_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/comments/45884086"},"html":{"href":"https://github.com/AgileVentures/LocalSupport/pull/196#discussion_r45884086"},"pull_request":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/196"}}},"pull_request":{"url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/196","id":50736858,"html_url":"https://github.com/AgileVentures/LocalSupport/pull/196","diff_url":"https://github.com/AgileVentures/LocalSupport/pull/196.diff","patch_url":"https://github.com/AgileVentures/LocalSupport/pull/196.patch","issue_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/196","number":196,"state":"open","locked":false,"title":"Allow admin to decline a user's \"This is My Organization\" request without deleting the user","user":{"login":"marianmosley","id":1031483,"avatar_url":"https://avatars.githubusercontent.com/u/1031483?v=3","gravatar_id":"","url":"https://api.github.com/users/marianmosley","html_url":"https://github.com/marianmosley","followers_url":"https://api.github.com/users/marianmosley/followers","following_url":"https://api.github.com/users/marianmosley/following{/other_user}","gists_url":"https://api.github.com/users/marianmosley/gists{/gist_id}","starred_url":"https://api.github.com/users/marianmosley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marianmosley/subscriptions","organizations_url":"https://api.github.com/users/marianmosley/orgs","repos_url":"https://api.github.com/users/marianmosley/repos","events_url":"https://api.github.com/users/marianmosley/events{/privacy}","received_events_url":"https://api.github.com/users/marianmosley/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-15T01:15:21Z","updated_at":"2015-11-25T16:03:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2caed84988ebbdc9185b893369c1c0ae72dee2c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/196/commits","review_comments_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/196/comments","review_comment_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/196/comments","statuses_url":"https://api.github.com/repos/AgileVentures/LocalSupport/statuses/ee0035ee658f5f8b3a36969eb405eb4027a73f30","head":{"label":"marianmosley:admin_decline_timo_but_do_not_delete_user","ref":"admin_decline_timo_but_do_not_delete_user","sha":"ee0035ee658f5f8b3a36969eb405eb4027a73f30","user":{"login":"marianmosley","id":1031483,"avatar_url":"https://avatars.githubusercontent.com/u/1031483?v=3","gravatar_id":"","url":"https://api.github.com/users/marianmosley","html_url":"https://github.com/marianmosley","followers_url":"https://api.github.com/users/marianmosley/followers","following_url":"https://api.github.com/users/marianmosley/following{/other_user}","gists_url":"https://api.github.com/users/marianmosley/gists{/gist_id}","starred_url":"https://api.github.com/users/marianmosley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marianmosley/subscriptions","organizations_url":"https://api.github.com/users/marianmosley/orgs","repos_url":"https://api.github.com/users/marianmosley/repos","events_url":"https://api.github.com/users/marianmosley/events{/privacy}","received_events_url":"https://api.github.com/users/marianmosley/received_events","type":"User","site_admin":false},"repo":{"id":8889304,"name":"LocalSupport","full_name":"marianmosley/LocalSupport","owner":{"login":"marianmosley","id":1031483,"avatar_url":"https://avatars.githubusercontent.com/u/1031483?v=3","gravatar_id":"","url":"https://api.github.com/users/marianmosley","html_url":"https://github.com/marianmosley","followers_url":"https://api.github.com/users/marianmosley/followers","following_url":"https://api.github.com/users/marianmosley/following{/other_user}","gists_url":"https://api.github.com/users/marianmosley/gists{/gist_id}","starred_url":"https://api.github.com/users/marianmosley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marianmosley/subscriptions","organizations_url":"https://api.github.com/users/marianmosley/orgs","repos_url":"https://api.github.com/users/marianmosley/repos","events_url":"https://api.github.com/users/marianmosley/events{/privacy}","received_events_url":"https://api.github.com/users/marianmosley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marianmosley/LocalSupport","description":"A directory of local support services","fork":true,"url":"https://api.github.com/repos/marianmosley/LocalSupport","forks_url":"https://api.github.com/repos/marianmosley/LocalSupport/forks","keys_url":"https://api.github.com/repos/marianmosley/LocalSupport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marianmosley/LocalSupport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marianmosley/LocalSupport/teams","hooks_url":"https://api.github.com/repos/marianmosley/LocalSupport/hooks","issue_events_url":"https://api.github.com/repos/marianmosley/LocalSupport/issues/events{/number}","events_url":"https://api.github.com/repos/marianmosley/LocalSupport/events","assignees_url":"https://api.github.com/repos/marianmosley/LocalSupport/assignees{/user}","branches_url":"https://api.github.com/repos/marianmosley/LocalSupport/branches{/branch}","tags_url":"https://api.github.com/repos/marianmosley/LocalSupport/tags","blobs_url":"https://api.github.com/repos/marianmosley/LocalSupport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marianmosley/LocalSupport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marianmosley/LocalSupport/git/refs{/sha}","trees_url":"https://api.github.com/repos/marianmosley/LocalSupport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marianmosley/LocalSupport/statuses/{sha}","languages_url":"https://api.github.com/repos/marianmosley/LocalSupport/languages","stargazers_url":"https://api.github.com/repos/marianmosley/LocalSupport/stargazers","contributors_url":"https://api.github.com/repos/marianmosley/LocalSupport/contributors","subscribers_url":"https://api.github.com/repos/marianmosley/LocalSupport/subscribers","subscription_url":"https://api.github.com/repos/marianmosley/LocalSupport/subscription","commits_url":"https://api.github.com/repos/marianmosley/LocalSupport/commits{/sha}","git_commits_url":"https://api.github.com/repos/marianmosley/LocalSupport/git/commits{/sha}","comments_url":"https://api.github.com/repos/marianmosley/LocalSupport/comments{/number}","issue_comment_url":"https://api.github.com/repos/marianmosley/LocalSupport/issues/comments{/number}","contents_url":"https://api.github.com/repos/marianmosley/LocalSupport/contents/{+path}","compare_url":"https://api.github.com/repos/marianmosley/LocalSupport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marianmosley/LocalSupport/merges","archive_url":"https://api.github.com/repos/marianmosley/LocalSupport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marianmosley/LocalSupport/downloads","issues_url":"https://api.github.com/repos/marianmosley/LocalSupport/issues{/number}","pulls_url":"https://api.github.com/repos/marianmosley/LocalSupport/pulls{/number}","milestones_url":"https://api.github.com/repos/marianmosley/LocalSupport/milestones{/number}","notifications_url":"https://api.github.com/repos/marianmosley/LocalSupport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marianmosley/LocalSupport/labels{/name}","releases_url":"https://api.github.com/repos/marianmosley/LocalSupport/releases{/id}","created_at":"2013-03-19T21:09:16Z","updated_at":"2014-09-10T13:54:35Z","pushed_at":"2015-11-24T22:55:08Z","git_url":"git://github.com/marianmosley/LocalSupport.git","ssh_url":"git@github.com:marianmosley/LocalSupport.git","clone_url":"https://github.com/marianmosley/LocalSupport.git","svn_url":"https://github.com/marianmosley/LocalSupport","homepage":null,"size":6445,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"develop"}},"base":{"label":"AgileVentures:develop","ref":"develop","sha":"39b9012f2143aee165144ed5790d22b8de2bf4fa","user":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"repo":{"id":14499588,"name":"LocalSupport","full_name":"AgileVentures/LocalSupport","owner":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AgileVentures/LocalSupport","description":"A directory of local support services and volunteer opportunities","fork":true,"url":"https://api.github.com/repos/AgileVentures/LocalSupport","forks_url":"https://api.github.com/repos/AgileVentures/LocalSupport/forks","keys_url":"https://api.github.com/repos/AgileVentures/LocalSupport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AgileVentures/LocalSupport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AgileVentures/LocalSupport/teams","hooks_url":"https://api.github.com/repos/AgileVentures/LocalSupport/hooks","issue_events_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/events{/number}","events_url":"https://api.github.com/repos/AgileVentures/LocalSupport/events","assignees_url":"https://api.github.com/repos/AgileVentures/LocalSupport/assignees{/user}","branches_url":"https://api.github.com/repos/AgileVentures/LocalSupport/branches{/branch}","tags_url":"https://api.github.com/repos/AgileVentures/LocalSupport/tags","blobs_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/refs{/sha}","trees_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AgileVentures/LocalSupport/statuses/{sha}","languages_url":"https://api.github.com/repos/AgileVentures/LocalSupport/languages","stargazers_url":"https://api.github.com/repos/AgileVentures/LocalSupport/stargazers","contributors_url":"https://api.github.com/repos/AgileVentures/LocalSupport/contributors","subscribers_url":"https://api.github.com/repos/AgileVentures/LocalSupport/subscribers","subscription_url":"https://api.github.com/repos/AgileVentures/LocalSupport/subscription","commits_url":"https://api.github.com/repos/AgileVentures/LocalSupport/commits{/sha}","git_commits_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/commits{/sha}","comments_url":"https://api.github.com/repos/AgileVentures/LocalSupport/comments{/number}","issue_comment_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/comments{/number}","contents_url":"https://api.github.com/repos/AgileVentures/LocalSupport/contents/{+path}","compare_url":"https://api.github.com/repos/AgileVentures/LocalSupport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AgileVentures/LocalSupport/merges","archive_url":"https://api.github.com/repos/AgileVentures/LocalSupport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AgileVentures/LocalSupport/downloads","issues_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues{/number}","pulls_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls{/number}","milestones_url":"https://api.github.com/repos/AgileVentures/LocalSupport/milestones{/number}","notifications_url":"https://api.github.com/repos/AgileVentures/LocalSupport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AgileVentures/LocalSupport/labels{/name}","releases_url":"https://api.github.com/repos/AgileVentures/LocalSupport/releases{/id}","created_at":"2013-11-18T17:24:59Z","updated_at":"2015-08-18T16:48:01Z","pushed_at":"2015-11-25T15:30:07Z","git_url":"git://github.com/AgileVentures/LocalSupport.git","ssh_url":"git@github.com:AgileVentures/LocalSupport.git","clone_url":"https://github.com/AgileVentures/LocalSupport.git","svn_url":"https://github.com/AgileVentures/LocalSupport","homepage":"http://www.harrowcn.org.uk","size":48621,"stargazers_count":14,"watchers_count":14,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":10,"forks":68,"open_issues":10,"watchers":14,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/196"},"html":{"href":"https://github.com/AgileVentures/LocalSupport/pull/196"},"issue":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/196"},"comments":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/196/comments"},"review_comments":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/196/comments"},"review_comment":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/196/commits"},"statuses":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/statuses/ee0035ee658f5f8b3a36969eb405eb4027a73f30"}}}}