{"action":"created","comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/188382746","pull_request_review_id":120350264,"id":188382746,"diff_hunk":"@@ -0,0 +1,12 @@\n+module EmailPreferenceConstants\n+  SOURCE_TYPES = [","path":"lib/cdo/email_preference_constants.rb","position":2,"original_position":2,"commit_id":"55bf854c66297979ef2e4182d217d1ec668a0297","original_commit_id":"55bf854c66297979ef2e4182d217d1ec668a0297","user":{"login":"sureshc","id":2157034,"avatar_url":"https://avatars0.githubusercontent.com/u/2157034?v=4","gravatar_id":"","url":"https://api.github.com/users/sureshc","html_url":"https://github.com/sureshc","followers_url":"https://api.github.com/users/sureshc/followers","following_url":"https://api.github.com/users/sureshc/following{/other_user}","gists_url":"https://api.github.com/users/sureshc/gists{/gist_id}","starred_url":"https://api.github.com/users/sureshc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sureshc/subscriptions","organizations_url":"https://api.github.com/users/sureshc/orgs","repos_url":"https://api.github.com/users/sureshc/repos","events_url":"https://api.github.com/users/sureshc/events{/privacy}","received_events_url":"https://api.github.com/users/sureshc/received_events","type":"User","site_admin":false},"body":"Should I define this as a hash instead?\r\n``` ruby\r\nSOURCE_TYPES = {\r\n     ACCOUNT_SIGN_UP => 'Teacher account sign up',\r\n     ACCOUNT_TYPE_CHANGE => 'Student account change to teacher',\r\n     ACCOUNT_EMAIL_ADD => 'Add email to teacher account',\r\n     ACCOUNT_EMAIL_CHANGE => 'Update teacher account email',\r\n     FORM_HOUR_OF_CODE => 'Host Hour of Code form',\r\n     FORM_VOLUNTEER => 'Volunteer form',\r\n     FORM_ACCESS_REPORT => 'Access Report form',\r\n     FORM_REGIONAL_PARTNER => 'Regional partner contact'\r\n   }.freeze\r\n```\r\n\r\nI think usage would be more precise?  `EmailPreferenceConstants::SOURCE_TYPES::FORM_ACCESS_REPORT`?","created_at":"2018-05-15T18:04:41Z","updated_at":"2018-05-15T18:04:41Z","html_url":"https://github.com/code-dot-org/code-dot-org/pull/22325#discussion_r188382746","pull_request_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/22325","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/188382746"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/22325#discussion_r188382746"},"pull_request":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/22325"}}},"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/22325","id":187309292,"html_url":"https://github.com/code-dot-org/code-dot-org/pull/22325","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/22325.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/22325.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/22325","number":22325,"state":"open","locked":false,"title":"Add Pegasus EmailPreference helper","user":{"login":"sureshc","id":2157034,"avatar_url":"https://avatars0.githubusercontent.com/u/2157034?v=4","gravatar_id":"","url":"https://api.github.com/users/sureshc","html_url":"https://github.com/sureshc","followers_url":"https://api.github.com/users/sureshc/followers","following_url":"https://api.github.com/users/sureshc/following{/other_user}","gists_url":"https://api.github.com/users/sureshc/gists{/gist_id}","starred_url":"https://api.github.com/users/sureshc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sureshc/subscriptions","organizations_url":"https://api.github.com/users/sureshc/orgs","repos_url":"https://api.github.com/users/sureshc/repos","events_url":"https://api.github.com/users/sureshc/events{/privacy}","received_events_url":"https://api.github.com/users/sureshc/received_events","type":"User","site_admin":false},"body":"Add helper Class so that Pegasus can write to Dashboard email_preferences table and update existing Dashboard controllers to use new shared EmailPreferenceConstants.","created_at":"2018-05-10T21:14:09Z","updated_at":"2018-05-15T18:04:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b56e403bb2053c70d9eb8d09fec07fd8fc23317f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"clareconstantine","id":224089,"avatar_url":"https://avatars2.githubusercontent.com/u/224089?v=4","gravatar_id":"","url":"https://api.github.com/users/clareconstantine","html_url":"https://github.com/clareconstantine","followers_url":"https://api.github.com/users/clareconstantine/followers","following_url":"https://api.github.com/users/clareconstantine/following{/other_user}","gists_url":"https://api.github.com/users/clareconstantine/gists{/gist_id}","starred_url":"https://api.github.com/users/clareconstantine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clareconstantine/subscriptions","organizations_url":"https://api.github.com/users/clareconstantine/orgs","repos_url":"https://api.github.com/users/clareconstantine/repos","events_url":"https://api.github.com/users/clareconstantine/events{/privacy}","received_events_url":"https://api.github.com/users/clareconstantine/received_events","type":"User","site_admin":false},{"login":"breville","id":2205926,"avatar_url":"https://avatars3.githubusercontent.com/u/2205926?v=4","gravatar_id":"","url":"https://api.github.com/users/breville","html_url":"https://github.com/breville","followers_url":"https://api.github.com/users/breville/followers","following_url":"https://api.github.com/users/breville/following{/other_user}","gists_url":"https://api.github.com/users/breville/gists{/gist_id}","starred_url":"https://api.github.com/users/breville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breville/subscriptions","organizations_url":"https://api.github.com/users/breville/orgs","repos_url":"https://api.github.com/users/breville/repos","events_url":"https://api.github.com/users/breville/events{/privacy}","received_events_url":"https://api.github.com/users/breville/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/22325/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/22325/comments","review_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/22325/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/55bf854c66297979ef2e4182d217d1ec668a0297","head":{"label":"code-dot-org:add-pegasus-emailpreference-helper","ref":"add-pegasus-emailpreference-helper","sha":"55bf854c66297979ef2e4182d217d1ec668a0297","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2018-05-15T17:45:39Z","pushed_at":"2018-05-15T18:03:22Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":7306960,"stargazers_count":311,"watchers_count":311,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":181,"mirror_url":null,"archived":false,"open_issues_count":141,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":181,"open_issues":141,"watchers":311,"default_branch":"staging"}},"base":{"label":"code-dot-org:staging","ref":"staging","sha":"b2418b7866cf669399efe521aebd3038dd34bb6b","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2018-05-15T17:45:39Z","pushed_at":"2018-05-15T18:03:22Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":7306960,"stargazers_count":311,"watchers_count":311,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":181,"mirror_url":null,"archived":false,"open_issues_count":141,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":181,"open_issues":141,"watchers":311,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/22325"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/22325"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/22325"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/22325/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/22325/comments"},"review_comment":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/22325/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/55bf854c66297979ef2e4182d217d1ec668a0297"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sureshc"}}