{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/email-alert-api/pulls/comments/174401317","pull_request_review_id":103747676,"id":174401317,"diff_hunk":"@@ -36,14 +50,18 @@ def smoke_test_address?\n \n   def subscriber\n     @subscriber ||= begin\n-                      found = Subscriber.where(\"LOWER(address) = ?\", address.downcase).first\n+                      found = find_subscriber\n                       found || Subscriber.create!(\n                         address: address,\n                         signon_user_uid: current_user.uid,\n                       )\n                     end\n   end\n \n+  def find_subscriber\n+    @find_subscriber ||= Subscriber.where(\"LOWER(address) = ?\", address.downcase).first","path":"app/controllers/subscriptions_controller.rb","position":35,"original_position":35,"commit_id":"f9d19870e18fb6a5ff6a99828b6f25753b64781e","original_commit_id":"ce9dde38487f1de270c596665e3ceec96bc7999f","user":{"login":"rubenarakelyan","id":444232,"avatar_url":"https://avatars0.githubusercontent.com/u/444232?v=4","gravatar_id":"","url":"https://api.github.com/users/rubenarakelyan","html_url":"https://github.com/rubenarakelyan","followers_url":"https://api.github.com/users/rubenarakelyan/followers","following_url":"https://api.github.com/users/rubenarakelyan/following{/other_user}","gists_url":"https://api.github.com/users/rubenarakelyan/gists{/gist_id}","starred_url":"https://api.github.com/users/rubenarakelyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubenarakelyan/subscriptions","organizations_url":"https://api.github.com/users/rubenarakelyan/orgs","repos_url":"https://api.github.com/users/rubenarakelyan/repos","events_url":"https://api.github.com/users/rubenarakelyan/events{/privacy}","received_events_url":"https://api.github.com/users/rubenarakelyan/received_events","type":"User","site_admin":false},"body":"Yes good idea","created_at":"2018-03-14T09:45:54Z","updated_at":"2018-03-14T09:45:54Z","html_url":"https://github.com/alphagov/email-alert-api/pull/522#discussion_r174401317","pull_request_url":"https://api.github.com/repos/alphagov/email-alert-api/pulls/522","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/alphagov/email-alert-api/pulls/comments/174401317"},"html":{"href":"https://github.com/alphagov/email-alert-api/pull/522#discussion_r174401317"},"pull_request":{"href":"https://api.github.com/repos/alphagov/email-alert-api/pulls/522"}},"in_reply_to_id":174371103},"pull_request":{"url":"https://api.github.com/repos/alphagov/email-alert-api/pulls/522","id":174704657,"html_url":"https://github.com/alphagov/email-alert-api/pull/522","diff_url":"https://github.com/alphagov/email-alert-api/pull/522.diff","patch_url":"https://github.com/alphagov/email-alert-api/pull/522.patch","issue_url":"https://api.github.com/repos/alphagov/email-alert-api/issues/522","number":522,"state":"open","locked":false,"title":"Add API endpoint to list a user’s subscriptions","user":{"login":"rubenarakelyan","id":444232,"avatar_url":"https://avatars0.githubusercontent.com/u/444232?v=4","gravatar_id":"","url":"https://api.github.com/users/rubenarakelyan","html_url":"https://github.com/rubenarakelyan","followers_url":"https://api.github.com/users/rubenarakelyan/followers","following_url":"https://api.github.com/users/rubenarakelyan/following{/other_user}","gists_url":"https://api.github.com/users/rubenarakelyan/gists{/gist_id}","starred_url":"https://api.github.com/users/rubenarakelyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubenarakelyan/subscriptions","organizations_url":"https://api.github.com/users/rubenarakelyan/orgs","repos_url":"https://api.github.com/users/rubenarakelyan/repos","events_url":"https://api.github.com/users/rubenarakelyan/events{/privacy}","received_events_url":"https://api.github.com/users/rubenarakelyan/received_events","type":"User","site_admin":false},"body":"This commit adds an API endpoint at `GET /subscriptions` that lists a user’s active subscriptions given an email address.\r\n\r\nTrello: https://trello.com/c/t9GWD8Rj/691-add-an-endpoint-to-email-alert-api-to-list-a-users-subscriptions","created_at":"2018-03-13T15:51:50Z","updated_at":"2018-03-14T09:45:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f08f79603b3e5706300d5a111198d2dfefbeeca8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/email-alert-api/pulls/522/commits","review_comments_url":"https://api.github.com/repos/alphagov/email-alert-api/pulls/522/comments","review_comment_url":"https://api.github.com/repos/alphagov/email-alert-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/email-alert-api/issues/522/comments","statuses_url":"https://api.github.com/repos/alphagov/email-alert-api/statuses/f9d19870e18fb6a5ff6a99828b6f25753b64781e","head":{"label":"alphagov:api-list-active-subscriptions","ref":"api-list-active-subscriptions","sha":"f9d19870e18fb6a5ff6a99828b6f25753b64781e","user":{"login":"alphagov","id":596977,"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":24410607,"name":"email-alert-api","full_name":"alphagov/email-alert-api","owner":{"login":"alphagov","id":596977,"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/email-alert-api","description":"Sends email alerts to the public for GOV.UK","fork":false,"url":"https://api.github.com/repos/alphagov/email-alert-api","forks_url":"https://api.github.com/repos/alphagov/email-alert-api/forks","keys_url":"https://api.github.com/repos/alphagov/email-alert-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/email-alert-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/email-alert-api/teams","hooks_url":"https://api.github.com/repos/alphagov/email-alert-api/hooks","issue_events_url":"https://api.github.com/repos/alphagov/email-alert-api/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/email-alert-api/events","assignees_url":"https://api.github.com/repos/alphagov/email-alert-api/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/email-alert-api/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/email-alert-api/tags","blobs_url":"https://api.github.com/repos/alphagov/email-alert-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/email-alert-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/email-alert-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/email-alert-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/email-alert-api/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/email-alert-api/languages","stargazers_url":"https://api.github.com/repos/alphagov/email-alert-api/stargazers","contributors_url":"https://api.github.com/repos/alphagov/email-alert-api/contributors","subscribers_url":"https://api.github.com/repos/alphagov/email-alert-api/subscribers","subscription_url":"https://api.github.com/repos/alphagov/email-alert-api/subscription","commits_url":"https://api.github.com/repos/alphagov/email-alert-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/email-alert-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/email-alert-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/email-alert-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/email-alert-api/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/email-alert-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/email-alert-api/merges","archive_url":"https://api.github.com/repos/alphagov/email-alert-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/email-alert-api/downloads","issues_url":"https://api.github.com/repos/alphagov/email-alert-api/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/email-alert-api/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/email-alert-api/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/email-alert-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/email-alert-api/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/email-alert-api/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/email-alert-api/deployments","created_at":"2014-09-24T10:22:32Z","updated_at":"2018-03-14T07:25:47Z","pushed_at":"2018-03-14T09:45:31Z","git_url":"git://github.com/alphagov/email-alert-api.git","ssh_url":"git@github.com:alphagov/email-alert-api.git","clone_url":"https://github.com/alphagov/email-alert-api.git","svn_url":"https://github.com/alphagov/email-alert-api","homepage":"https://docs.publishing.service.gov.uk/apps/email-alert-api.html","size":3571,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"749bbf7e9c755d3bdf26b93301ee8345bbc12997","user":{"login":"alphagov","id":596977,"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":24410607,"name":"email-alert-api","full_name":"alphagov/email-alert-api","owner":{"login":"alphagov","id":596977,"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/email-alert-api","description":"Sends email alerts to the public for GOV.UK","fork":false,"url":"https://api.github.com/repos/alphagov/email-alert-api","forks_url":"https://api.github.com/repos/alphagov/email-alert-api/forks","keys_url":"https://api.github.com/repos/alphagov/email-alert-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/email-alert-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/email-alert-api/teams","hooks_url":"https://api.github.com/repos/alphagov/email-alert-api/hooks","issue_events_url":"https://api.github.com/repos/alphagov/email-alert-api/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/email-alert-api/events","assignees_url":"https://api.github.com/repos/alphagov/email-alert-api/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/email-alert-api/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/email-alert-api/tags","blobs_url":"https://api.github.com/repos/alphagov/email-alert-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/email-alert-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/email-alert-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/email-alert-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/email-alert-api/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/email-alert-api/languages","stargazers_url":"https://api.github.com/repos/alphagov/email-alert-api/stargazers","contributors_url":"https://api.github.com/repos/alphagov/email-alert-api/contributors","subscribers_url":"https://api.github.com/repos/alphagov/email-alert-api/subscribers","subscription_url":"https://api.github.com/repos/alphagov/email-alert-api/subscription","commits_url":"https://api.github.com/repos/alphagov/email-alert-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/email-alert-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/email-alert-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/email-alert-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/email-alert-api/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/email-alert-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/email-alert-api/merges","archive_url":"https://api.github.com/repos/alphagov/email-alert-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/email-alert-api/downloads","issues_url":"https://api.github.com/repos/alphagov/email-alert-api/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/email-alert-api/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/email-alert-api/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/email-alert-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/email-alert-api/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/email-alert-api/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/email-alert-api/deployments","created_at":"2014-09-24T10:22:32Z","updated_at":"2018-03-14T07:25:47Z","pushed_at":"2018-03-14T09:45:31Z","git_url":"git://github.com/alphagov/email-alert-api.git","ssh_url":"git@github.com:alphagov/email-alert-api.git","clone_url":"https://github.com/alphagov/email-alert-api.git","svn_url":"https://github.com/alphagov/email-alert-api","homepage":"https://docs.publishing.service.gov.uk/apps/email-alert-api.html","size":3571,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/email-alert-api/pulls/522"},"html":{"href":"https://github.com/alphagov/email-alert-api/pull/522"},"issue":{"href":"https://api.github.com/repos/alphagov/email-alert-api/issues/522"},"comments":{"href":"https://api.github.com/repos/alphagov/email-alert-api/issues/522/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/email-alert-api/pulls/522/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/email-alert-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/email-alert-api/pulls/522/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/email-alert-api/statuses/f9d19870e18fb6a5ff6a99828b6f25753b64781e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rubenarakelyan"}}