{"action":"opened","number":3,"pull_request":{"url":"https://api.github.com/repos/wkjagt/review-all-the-things/pulls/3","id":31092404,"html_url":"https://github.com/wkjagt/review-all-the-things/pull/3","diff_url":"https://github.com/wkjagt/review-all-the-things/pull/3.diff","patch_url":"https://github.com/wkjagt/review-all-the-things/pull/3.patch","issue_url":"https://api.github.com/repos/wkjagt/review-all-the-things/issues/3","number":3,"state":"open","locked":false,"title":"Fix the case where a reviewer is mentioned and a new review is created","user":{"login":"wkjagt","id":327048,"avatar_url":"https://avatars.githubusercontent.com/u/327048?v=3","gravatar_id":"","url":"https://api.github.com/users/wkjagt","html_url":"https://github.com/wkjagt","followers_url":"https://api.github.com/users/wkjagt/followers","following_url":"https://api.github.com/users/wkjagt/following{/other_user}","gists_url":"https://api.github.com/users/wkjagt/gists{/gist_id}","starred_url":"https://api.github.com/users/wkjagt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkjagt/subscriptions","organizations_url":"https://api.github.com/users/wkjagt/orgs","repos_url":"https://api.github.com/users/wkjagt/repos","events_url":"https://api.github.com/users/wkjagt/events{/privacy}","received_events_url":"https://api.github.com/users/wkjagt/received_events","type":"User","site_admin":false},"body":"As discussed IRL earlier today, when mentioning a github user in a PR that this user is already reviewing, a new review is created, which explains the double reviews that are seen in the Chrome extension. This PR fixes that by making sure that creating a review for a github user never creates a duplicate, but rather updates the existing one to have the status `to_review` if one already exists.\r\n\r\n@sgnr, @gmalette can you check if the way I override `#create` in the `has_many` relation is legit please?","created_at":"2015-03-13T01:00:39Z","updated_at":"2015-03-13T01:00:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wkjagt/review-all-the-things/pulls/3/commits","review_comments_url":"https://api.github.com/repos/wkjagt/review-all-the-things/pulls/3/comments","review_comment_url":"https://api.github.com/repos/wkjagt/review-all-the-things/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wkjagt/review-all-the-things/issues/3/comments","statuses_url":"https://api.github.com/repos/wkjagt/review-all-the-things/statuses/4066892f8a49cd7c4b6fc1803a078b1bedc48f84","head":{"label":"wkjagt:fix-multiple-reviews","ref":"fix-multiple-reviews","sha":"4066892f8a49cd7c4b6fc1803a078b1bedc48f84","user":{"login":"wkjagt","id":327048,"avatar_url":"https://avatars.githubusercontent.com/u/327048?v=3","gravatar_id":"","url":"https://api.github.com/users/wkjagt","html_url":"https://github.com/wkjagt","followers_url":"https://api.github.com/users/wkjagt/followers","following_url":"https://api.github.com/users/wkjagt/following{/other_user}","gists_url":"https://api.github.com/users/wkjagt/gists{/gist_id}","starred_url":"https://api.github.com/users/wkjagt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkjagt/subscriptions","organizations_url":"https://api.github.com/users/wkjagt/orgs","repos_url":"https://api.github.com/users/wkjagt/repos","events_url":"https://api.github.com/users/wkjagt/events{/privacy}","received_events_url":"https://api.github.com/users/wkjagt/received_events","type":"User","site_admin":false},"repo":{"id":30124240,"name":"review-all-the-things","full_name":"wkjagt/review-all-the-things","owner":{"login":"wkjagt","id":327048,"avatar_url":"https://avatars.githubusercontent.com/u/327048?v=3","gravatar_id":"","url":"https://api.github.com/users/wkjagt","html_url":"https://github.com/wkjagt","followers_url":"https://api.github.com/users/wkjagt/followers","following_url":"https://api.github.com/users/wkjagt/following{/other_user}","gists_url":"https://api.github.com/users/wkjagt/gists{/gist_id}","starred_url":"https://api.github.com/users/wkjagt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkjagt/subscriptions","organizations_url":"https://api.github.com/users/wkjagt/orgs","repos_url":"https://api.github.com/users/wkjagt/repos","events_url":"https://api.github.com/users/wkjagt/events{/privacy}","received_events_url":"https://api.github.com/users/wkjagt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wkjagt/review-all-the-things","description":"Remember which pull requests you need to review","fork":false,"url":"https://api.github.com/repos/wkjagt/review-all-the-things","forks_url":"https://api.github.com/repos/wkjagt/review-all-the-things/forks","keys_url":"https://api.github.com/repos/wkjagt/review-all-the-things/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wkjagt/review-all-the-things/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wkjagt/review-all-the-things/teams","hooks_url":"https://api.github.com/repos/wkjagt/review-all-the-things/hooks","issue_events_url":"https://api.github.com/repos/wkjagt/review-all-the-things/issues/events{/number}","events_url":"https://api.github.com/repos/wkjagt/review-all-the-things/events","assignees_url":"https://api.github.com/repos/wkjagt/review-all-the-things/assignees{/user}","branches_url":"https://api.github.com/repos/wkjagt/review-all-the-things/branches{/branch}","tags_url":"https://api.github.com/repos/wkjagt/review-all-the-things/tags","blobs_url":"https://api.github.com/repos/wkjagt/review-all-the-things/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wkjagt/review-all-the-things/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wkjagt/review-all-the-things/git/refs{/sha}","trees_url":"https://api.github.com/repos/wkjagt/review-all-the-things/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wkjagt/review-all-the-things/statuses/{sha}","languages_url":"https://api.github.com/repos/wkjagt/review-all-the-things/languages","stargazers_url":"https://api.github.com/repos/wkjagt/review-all-the-things/stargazers","contributors_url":"https://api.github.com/repos/wkjagt/review-all-the-things/contributors","subscribers_url":"https://api.github.com/repos/wkjagt/review-all-the-things/subscribers","subscription_url":"https://api.github.com/repos/wkjagt/review-all-the-things/subscription","commits_url":"https://api.github.com/repos/wkjagt/review-all-the-things/commits{/sha}","git_commits_url":"https://api.github.com/repos/wkjagt/review-all-the-things/git/commits{/sha}","comments_url":"https://api.github.com/repos/wkjagt/review-all-the-things/comments{/number}","issue_comment_url":"https://api.github.com/repos/wkjagt/review-all-the-things/issues/comments{/number}","contents_url":"https://api.github.com/repos/wkjagt/review-all-the-things/contents/{+path}","compare_url":"https://api.github.com/repos/wkjagt/review-all-the-things/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wkjagt/review-all-the-things/merges","archive_url":"https://api.github.com/repos/wkjagt/review-all-the-things/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wkjagt/review-all-the-things/downloads","issues_url":"https://api.github.com/repos/wkjagt/review-all-the-things/issues{/number}","pulls_url":"https://api.github.com/repos/wkjagt/review-all-the-things/pulls{/number}","milestones_url":"https://api.github.com/repos/wkjagt/review-all-the-things/milestones{/number}","notifications_url":"https://api.github.com/repos/wkjagt/review-all-the-things/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wkjagt/review-all-the-things/labels{/name}","releases_url":"https://api.github.com/repos/wkjagt/review-all-the-things/releases{/id}","created_at":"2015-01-31T19:57:16Z","updated_at":"2015-03-12T23:05:06Z","pushed_at":"2015-03-13T00:56:46Z","git_url":"git://github.com/wkjagt/review-all-the-things.git","ssh_url":"git@github.com:wkjagt/review-all-the-things.git","clone_url":"https://github.com/wkjagt/review-all-the-things.git","svn_url":"https://github.com/wkjagt/review-all-the-things","homepage":null,"size":360,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"wkjagt:master","ref":"master","sha":"e9ab73a46060033e8520c9bf6e795cb99b51e849","user":{"login":"wkjagt","id":327048,"avatar_url":"https://avatars.githubusercontent.com/u/327048?v=3","gravatar_id":"","url":"https://api.github.com/users/wkjagt","html_url":"https://github.com/wkjagt","followers_url":"https://api.github.com/users/wkjagt/followers","following_url":"https://api.github.com/users/wkjagt/following{/other_user}","gists_url":"https://api.github.com/users/wkjagt/gists{/gist_id}","starred_url":"https://api.github.com/users/wkjagt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkjagt/subscriptions","organizations_url":"https://api.github.com/users/wkjagt/orgs","repos_url":"https://api.github.com/users/wkjagt/repos","events_url":"https://api.github.com/users/wkjagt/events{/privacy}","received_events_url":"https://api.github.com/users/wkjagt/received_events","type":"User","site_admin":false},"repo":{"id":30124240,"name":"review-all-the-things","full_name":"wkjagt/review-all-the-things","owner":{"login":"wkjagt","id":327048,"avatar_url":"https://avatars.githubusercontent.com/u/327048?v=3","gravatar_id":"","url":"https://api.github.com/users/wkjagt","html_url":"https://github.com/wkjagt","followers_url":"https://api.github.com/users/wkjagt/followers","following_url":"https://api.github.com/users/wkjagt/following{/other_user}","gists_url":"https://api.github.com/users/wkjagt/gists{/gist_id}","starred_url":"https://api.github.com/users/wkjagt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkjagt/subscriptions","organizations_url":"https://api.github.com/users/wkjagt/orgs","repos_url":"https://api.github.com/users/wkjagt/repos","events_url":"https://api.github.com/users/wkjagt/events{/privacy}","received_events_url":"https://api.github.com/users/wkjagt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wkjagt/review-all-the-things","description":"Remember which pull requests you need to review","fork":false,"url":"https://api.github.com/repos/wkjagt/review-all-the-things","forks_url":"https://api.github.com/repos/wkjagt/review-all-the-things/forks","keys_url":"https://api.github.com/repos/wkjagt/review-all-the-things/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wkjagt/review-all-the-things/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wkjagt/review-all-the-things/teams","hooks_url":"https://api.github.com/repos/wkjagt/review-all-the-things/hooks","issue_events_url":"https://api.github.com/repos/wkjagt/review-all-the-things/issues/events{/number}","events_url":"https://api.github.com/repos/wkjagt/review-all-the-things/events","assignees_url":"https://api.github.com/repos/wkjagt/review-all-the-things/assignees{/user}","branches_url":"https://api.github.com/repos/wkjagt/review-all-the-things/branches{/branch}","tags_url":"https://api.github.com/repos/wkjagt/review-all-the-things/tags","blobs_url":"https://api.github.com/repos/wkjagt/review-all-the-things/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wkjagt/review-all-the-things/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wkjagt/review-all-the-things/git/refs{/sha}","trees_url":"https://api.github.com/repos/wkjagt/review-all-the-things/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wkjagt/review-all-the-things/statuses/{sha}","languages_url":"https://api.github.com/repos/wkjagt/review-all-the-things/languages","stargazers_url":"https://api.github.com/repos/wkjagt/review-all-the-things/stargazers","contributors_url":"https://api.github.com/repos/wkjagt/review-all-the-things/contributors","subscribers_url":"https://api.github.com/repos/wkjagt/review-all-the-things/subscribers","subscription_url":"https://api.github.com/repos/wkjagt/review-all-the-things/subscription","commits_url":"https://api.github.com/repos/wkjagt/review-all-the-things/commits{/sha}","git_commits_url":"https://api.github.com/repos/wkjagt/review-all-the-things/git/commits{/sha}","comments_url":"https://api.github.com/repos/wkjagt/review-all-the-things/comments{/number}","issue_comment_url":"https://api.github.com/repos/wkjagt/review-all-the-things/issues/comments{/number}","contents_url":"https://api.github.com/repos/wkjagt/review-all-the-things/contents/{+path}","compare_url":"https://api.github.com/repos/wkjagt/review-all-the-things/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wkjagt/review-all-the-things/merges","archive_url":"https://api.github.com/repos/wkjagt/review-all-the-things/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wkjagt/review-all-the-things/downloads","issues_url":"https://api.github.com/repos/wkjagt/review-all-the-things/issues{/number}","pulls_url":"https://api.github.com/repos/wkjagt/review-all-the-things/pulls{/number}","milestones_url":"https://api.github.com/repos/wkjagt/review-all-the-things/milestones{/number}","notifications_url":"https://api.github.com/repos/wkjagt/review-all-the-things/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wkjagt/review-all-the-things/labels{/name}","releases_url":"https://api.github.com/repos/wkjagt/review-all-the-things/releases{/id}","created_at":"2015-01-31T19:57:16Z","updated_at":"2015-03-12T23:05:06Z","pushed_at":"2015-03-13T00:56:46Z","git_url":"git://github.com/wkjagt/review-all-the-things.git","ssh_url":"git@github.com:wkjagt/review-all-the-things.git","clone_url":"https://github.com/wkjagt/review-all-the-things.git","svn_url":"https://github.com/wkjagt/review-all-the-things","homepage":null,"size":360,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wkjagt/review-all-the-things/pulls/3"},"html":{"href":"https://github.com/wkjagt/review-all-the-things/pull/3"},"issue":{"href":"https://api.github.com/repos/wkjagt/review-all-the-things/issues/3"},"comments":{"href":"https://api.github.com/repos/wkjagt/review-all-the-things/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/wkjagt/review-all-the-things/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/wkjagt/review-all-the-things/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wkjagt/review-all-the-things/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/wkjagt/review-all-the-things/statuses/4066892f8a49cd7c4b6fc1803a078b1bedc48f84"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":52,"deletions":3,"changed_files":2}}