{"action":"created","comment":{"url":"https://api.github.com/repos/ilyakava/sup/pulls/comments/46060477","id":46060477,"diff_hunk":"@@ -0,0 +1,15 @@\n+class DowncaseEmailAndRemoveDuplicateEntries < ActiveRecord::Migration\n+  def change\n+  \tmembers = Member.all\n+  \temails = []\n+  \tmembers.each do |member|\n+  \t\tmember.email.downcase!\n+  \t\tif emails.include?(member.email)\n+  \t\t\tmember.destroy\n+  \t\telse\n+  \t\t\temails<<member.email\n+  \t\t\tmember.save!\n+  \t\tend\n+  \tend","path":"db/migrate/20151127162510_downcase_email_and_remove_duplicate_entries.rb","position":13,"original_position":13,"commit_id":"39ada5c3ac146a9870a5d4c670d39aa6c1cf2fde","original_commit_id":"39ada5c3ac146a9870a5d4c670d39aa6c1cf2fde","user":{"login":"4p00rv","id":11488287,"avatar_url":"https://avatars.githubusercontent.com/u/11488287?v=3","gravatar_id":"","url":"https://api.github.com/users/4p00rv","html_url":"https://github.com/4p00rv","followers_url":"https://api.github.com/users/4p00rv/followers","following_url":"https://api.github.com/users/4p00rv/following{/other_user}","gists_url":"https://api.github.com/users/4p00rv/gists{/gist_id}","starred_url":"https://api.github.com/users/4p00rv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4p00rv/subscriptions","organizations_url":"https://api.github.com/users/4p00rv/orgs","repos_url":"https://api.github.com/users/4p00rv/repos","events_url":"https://api.github.com/users/4p00rv/events{/privacy}","received_events_url":"https://api.github.com/users/4p00rv/received_events","type":"User","site_admin":false},"body":"How about this? Checking if the email is already present in an array and deleting if its true","created_at":"2015-11-27T16:39:12Z","updated_at":"2015-11-27T16:39:12Z","html_url":"https://github.com/ilyakava/sup/pull/67#discussion_r46060477","pull_request_url":"https://api.github.com/repos/ilyakava/sup/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/ilyakava/sup/pulls/comments/46060477"},"html":{"href":"https://github.com/ilyakava/sup/pull/67#discussion_r46060477"},"pull_request":{"href":"https://api.github.com/repos/ilyakava/sup/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/ilyakava/sup/pulls/67","id":51719464,"html_url":"https://github.com/ilyakava/sup/pull/67","diff_url":"https://github.com/ilyakava/sup/pull/67.diff","patch_url":"https://github.com/ilyakava/sup/pull/67.patch","issue_url":"https://api.github.com/repos/ilyakava/sup/issues/67","number":67,"state":"open","locked":false,"title":"Fixed multiple members with same email","user":{"login":"4p00rv","id":11488287,"avatar_url":"https://avatars.githubusercontent.com/u/11488287?v=3","gravatar_id":"","url":"https://api.github.com/users/4p00rv","html_url":"https://github.com/4p00rv","followers_url":"https://api.github.com/users/4p00rv/followers","following_url":"https://api.github.com/users/4p00rv/following{/other_user}","gists_url":"https://api.github.com/users/4p00rv/gists{/gist_id}","starred_url":"https://api.github.com/users/4p00rv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4p00rv/subscriptions","organizations_url":"https://api.github.com/users/4p00rv/orgs","repos_url":"https://api.github.com/users/4p00rv/repos","events_url":"https://api.github.com/users/4p00rv/events{/privacy}","received_events_url":"https://api.github.com/users/4p00rv/received_events","type":"User","site_admin":false},"body":"Fix for issue #63. This was rather a small fix, now the code is changing the email to `downcase` before saving it in the database. Do I need to add tests for this?\r\n@dblock and @ilyakava  please review.","created_at":"2015-11-24T21:27:41Z","updated_at":"2015-11-27T16:39:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"894e947e3c47c2b8c67f781da9aeaee2ce94198a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ilyakava/sup/pulls/67/commits","review_comments_url":"https://api.github.com/repos/ilyakava/sup/pulls/67/comments","review_comment_url":"https://api.github.com/repos/ilyakava/sup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ilyakava/sup/issues/67/comments","statuses_url":"https://api.github.com/repos/ilyakava/sup/statuses/39ada5c3ac146a9870a5d4c670d39aa6c1cf2fde","head":{"label":"4p00rv:email_check","ref":"email_check","sha":"39ada5c3ac146a9870a5d4c670d39aa6c1cf2fde","user":{"login":"4p00rv","id":11488287,"avatar_url":"https://avatars.githubusercontent.com/u/11488287?v=3","gravatar_id":"","url":"https://api.github.com/users/4p00rv","html_url":"https://github.com/4p00rv","followers_url":"https://api.github.com/users/4p00rv/followers","following_url":"https://api.github.com/users/4p00rv/following{/other_user}","gists_url":"https://api.github.com/users/4p00rv/gists{/gist_id}","starred_url":"https://api.github.com/users/4p00rv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4p00rv/subscriptions","organizations_url":"https://api.github.com/users/4p00rv/orgs","repos_url":"https://api.github.com/users/4p00rv/repos","events_url":"https://api.github.com/users/4p00rv/events{/privacy}","received_events_url":"https://api.github.com/users/4p00rv/received_events","type":"User","site_admin":false},"repo":{"id":45822801,"name":"sup","full_name":"4p00rv/sup","owner":{"login":"4p00rv","id":11488287,"avatar_url":"https://avatars.githubusercontent.com/u/11488287?v=3","gravatar_id":"","url":"https://api.github.com/users/4p00rv","html_url":"https://github.com/4p00rv","followers_url":"https://api.github.com/users/4p00rv/followers","following_url":"https://api.github.com/users/4p00rv/following{/other_user}","gists_url":"https://api.github.com/users/4p00rv/gists{/gist_id}","starred_url":"https://api.github.com/users/4p00rv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4p00rv/subscriptions","organizations_url":"https://api.github.com/users/4p00rv/orgs","repos_url":"https://api.github.com/users/4p00rv/repos","events_url":"https://api.github.com/users/4p00rv/events{/privacy}","received_events_url":"https://api.github.com/users/4p00rv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/4p00rv/sup","description":"A web app to bring together a company's members","fork":true,"url":"https://api.github.com/repos/4p00rv/sup","forks_url":"https://api.github.com/repos/4p00rv/sup/forks","keys_url":"https://api.github.com/repos/4p00rv/sup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4p00rv/sup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4p00rv/sup/teams","hooks_url":"https://api.github.com/repos/4p00rv/sup/hooks","issue_events_url":"https://api.github.com/repos/4p00rv/sup/issues/events{/number}","events_url":"https://api.github.com/repos/4p00rv/sup/events","assignees_url":"https://api.github.com/repos/4p00rv/sup/assignees{/user}","branches_url":"https://api.github.com/repos/4p00rv/sup/branches{/branch}","tags_url":"https://api.github.com/repos/4p00rv/sup/tags","blobs_url":"https://api.github.com/repos/4p00rv/sup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4p00rv/sup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4p00rv/sup/git/refs{/sha}","trees_url":"https://api.github.com/repos/4p00rv/sup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4p00rv/sup/statuses/{sha}","languages_url":"https://api.github.com/repos/4p00rv/sup/languages","stargazers_url":"https://api.github.com/repos/4p00rv/sup/stargazers","contributors_url":"https://api.github.com/repos/4p00rv/sup/contributors","subscribers_url":"https://api.github.com/repos/4p00rv/sup/subscribers","subscription_url":"https://api.github.com/repos/4p00rv/sup/subscription","commits_url":"https://api.github.com/repos/4p00rv/sup/commits{/sha}","git_commits_url":"https://api.github.com/repos/4p00rv/sup/git/commits{/sha}","comments_url":"https://api.github.com/repos/4p00rv/sup/comments{/number}","issue_comment_url":"https://api.github.com/repos/4p00rv/sup/issues/comments{/number}","contents_url":"https://api.github.com/repos/4p00rv/sup/contents/{+path}","compare_url":"https://api.github.com/repos/4p00rv/sup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4p00rv/sup/merges","archive_url":"https://api.github.com/repos/4p00rv/sup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4p00rv/sup/downloads","issues_url":"https://api.github.com/repos/4p00rv/sup/issues{/number}","pulls_url":"https://api.github.com/repos/4p00rv/sup/pulls{/number}","milestones_url":"https://api.github.com/repos/4p00rv/sup/milestones{/number}","notifications_url":"https://api.github.com/repos/4p00rv/sup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4p00rv/sup/labels{/name}","releases_url":"https://api.github.com/repos/4p00rv/sup/releases{/id}","created_at":"2015-11-09T07:41:48Z","updated_at":"2015-11-09T07:41:51Z","pushed_at":"2015-11-27T16:33:05Z","git_url":"git://github.com/4p00rv/sup.git","ssh_url":"git@github.com:4p00rv/sup.git","clone_url":"https://github.com/4p00rv/sup.git","svn_url":"https://github.com/4p00rv/sup","homepage":"","size":279,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"ilyakava:master","ref":"master","sha":"b2a36047ad9ab82478b515b51bbc23a8101d5855","user":{"login":"ilyakava","id":4393191,"avatar_url":"https://avatars.githubusercontent.com/u/4393191?v=3","gravatar_id":"","url":"https://api.github.com/users/ilyakava","html_url":"https://github.com/ilyakava","followers_url":"https://api.github.com/users/ilyakava/followers","following_url":"https://api.github.com/users/ilyakava/following{/other_user}","gists_url":"https://api.github.com/users/ilyakava/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyakava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyakava/subscriptions","organizations_url":"https://api.github.com/users/ilyakava/orgs","repos_url":"https://api.github.com/users/ilyakava/repos","events_url":"https://api.github.com/users/ilyakava/events{/privacy}","received_events_url":"https://api.github.com/users/ilyakava/received_events","type":"User","site_admin":false},"repo":{"id":17992784,"name":"sup","full_name":"ilyakava/sup","owner":{"login":"ilyakava","id":4393191,"avatar_url":"https://avatars.githubusercontent.com/u/4393191?v=3","gravatar_id":"","url":"https://api.github.com/users/ilyakava","html_url":"https://github.com/ilyakava","followers_url":"https://api.github.com/users/ilyakava/followers","following_url":"https://api.github.com/users/ilyakava/following{/other_user}","gists_url":"https://api.github.com/users/ilyakava/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyakava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyakava/subscriptions","organizations_url":"https://api.github.com/users/ilyakava/orgs","repos_url":"https://api.github.com/users/ilyakava/repos","events_url":"https://api.github.com/users/ilyakava/events{/privacy}","received_events_url":"https://api.github.com/users/ilyakava/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilyakava/sup","description":"A web app to bring together a company's members","fork":false,"url":"https://api.github.com/repos/ilyakava/sup","forks_url":"https://api.github.com/repos/ilyakava/sup/forks","keys_url":"https://api.github.com/repos/ilyakava/sup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilyakava/sup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilyakava/sup/teams","hooks_url":"https://api.github.com/repos/ilyakava/sup/hooks","issue_events_url":"https://api.github.com/repos/ilyakava/sup/issues/events{/number}","events_url":"https://api.github.com/repos/ilyakava/sup/events","assignees_url":"https://api.github.com/repos/ilyakava/sup/assignees{/user}","branches_url":"https://api.github.com/repos/ilyakava/sup/branches{/branch}","tags_url":"https://api.github.com/repos/ilyakava/sup/tags","blobs_url":"https://api.github.com/repos/ilyakava/sup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilyakava/sup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilyakava/sup/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilyakava/sup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilyakava/sup/statuses/{sha}","languages_url":"https://api.github.com/repos/ilyakava/sup/languages","stargazers_url":"https://api.github.com/repos/ilyakava/sup/stargazers","contributors_url":"https://api.github.com/repos/ilyakava/sup/contributors","subscribers_url":"https://api.github.com/repos/ilyakava/sup/subscribers","subscription_url":"https://api.github.com/repos/ilyakava/sup/subscription","commits_url":"https://api.github.com/repos/ilyakava/sup/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilyakava/sup/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilyakava/sup/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilyakava/sup/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilyakava/sup/contents/{+path}","compare_url":"https://api.github.com/repos/ilyakava/sup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilyakava/sup/merges","archive_url":"https://api.github.com/repos/ilyakava/sup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilyakava/sup/downloads","issues_url":"https://api.github.com/repos/ilyakava/sup/issues{/number}","pulls_url":"https://api.github.com/repos/ilyakava/sup/pulls{/number}","milestones_url":"https://api.github.com/repos/ilyakava/sup/milestones{/number}","notifications_url":"https://api.github.com/repos/ilyakava/sup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilyakava/sup/labels{/name}","releases_url":"https://api.github.com/repos/ilyakava/sup/releases{/id}","created_at":"2014-03-21T20:06:37Z","updated_at":"2015-11-08T14:17:42Z","pushed_at":"2015-11-27T16:33:06Z","git_url":"git://github.com/ilyakava/sup.git","ssh_url":"git@github.com:ilyakava/sup.git","clone_url":"https://github.com/ilyakava/sup.git","svn_url":"https://github.com/ilyakava/sup","homepage":"","size":280,"stargazers_count":11,"watchers_count":11,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":28,"forks":10,"open_issues":28,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ilyakava/sup/pulls/67"},"html":{"href":"https://github.com/ilyakava/sup/pull/67"},"issue":{"href":"https://api.github.com/repos/ilyakava/sup/issues/67"},"comments":{"href":"https://api.github.com/repos/ilyakava/sup/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/ilyakava/sup/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/ilyakava/sup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ilyakava/sup/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/ilyakava/sup/statuses/39ada5c3ac146a9870a5d4c670d39aa6c1cf2fde"}}}}