{"action":"created","comment":{"url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/comments/58364501","id":58364501,"diff_hunk":"@@ -3,7 +3,11 @@ class VotesController < ApplicationController\n   before_action :set_vote,       only: %i(show edit update)\n \n   def new\n-    @vote = Vote.new\n+    if current_user.vote","path":"app/controllers/votes_controller.rb","position":5,"original_position":5,"commit_id":"7f494454817fa5aa9b5f62d06351cb1a6c25b413","original_commit_id":"7f494454817fa5aa9b5f62d06351cb1a6c25b413","user":{"login":"yucao24hours","id":1979779,"avatar_url":"https://avatars.githubusercontent.com/u/1979779?v=3","gravatar_id":"","url":"https://api.github.com/users/yucao24hours","html_url":"https://github.com/yucao24hours","followers_url":"https://api.github.com/users/yucao24hours/followers","following_url":"https://api.github.com/users/yucao24hours/following{/other_user}","gists_url":"https://api.github.com/users/yucao24hours/gists{/gist_id}","starred_url":"https://api.github.com/users/yucao24hours/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yucao24hours/subscriptions","organizations_url":"https://api.github.com/users/yucao24hours/orgs","repos_url":"https://api.github.com/users/yucao24hours/repos","events_url":"https://api.github.com/users/yucao24hours/events{/privacy}","received_events_url":"https://api.github.com/users/yucao24hours/received_events","type":"User","site_admin":false},"body":"レビュー遅くなってしまってすみません💦\r\nここの条件分岐なんですが、アクションとして望ましい処理の方(つまりここでは、new アクションなので @Vote.new )が先に来て、そうではないデータの対応を else に書く方が文脈がわかりやすいかなと思いました💫","created_at":"2016-04-04T11:56:27Z","updated_at":"2016-04-04T11:56:27Z","html_url":"https://github.com/yochiyochirb/kajaeru/pull/83#discussion_r58364501","pull_request_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/83","_links":{"self":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/comments/58364501"},"html":{"href":"https://github.com/yochiyochirb/kajaeru/pull/83#discussion_r58364501"},"pull_request":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/83"}}},"pull_request":{"url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/83","id":24098577,"html_url":"https://github.com/yochiyochirb/kajaeru/pull/83","diff_url":"https://github.com/yochiyochirb/kajaeru/pull/83.diff","patch_url":"https://github.com/yochiyochirb/kajaeru/pull/83.patch","issue_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/83","number":83,"state":"open","locked":false,"title":"投票済みのユーザーは新規投票機能を利用させない","user":{"login":"ta1kt0me","id":1412864,"avatar_url":"https://avatars.githubusercontent.com/u/1412864?v=3","gravatar_id":"","url":"https://api.github.com/users/ta1kt0me","html_url":"https://github.com/ta1kt0me","followers_url":"https://api.github.com/users/ta1kt0me/followers","following_url":"https://api.github.com/users/ta1kt0me/following{/other_user}","gists_url":"https://api.github.com/users/ta1kt0me/gists{/gist_id}","starred_url":"https://api.github.com/users/ta1kt0me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ta1kt0me/subscriptions","organizations_url":"https://api.github.com/users/ta1kt0me/orgs","repos_url":"https://api.github.com/users/ta1kt0me/repos","events_url":"https://api.github.com/users/ta1kt0me/events{/privacy}","received_events_url":"https://api.github.com/users/ta1kt0me/received_events","type":"User","site_admin":false},"body":"* 投票済みのユーザーが新規投票しようとしたらトップページにリダイレクト\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/yochiyochirb/kajaeru/83)\n<!-- Reviewable:end -->\n","created_at":"2014-11-08T07:46:23Z","updated_at":"2016-04-04T11:56:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"036518419a8cc5dc43f8b6c204bc2b4a032a80f2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/83/commits","review_comments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/83/comments","review_comment_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/83/comments","statuses_url":"https://api.github.com/repos/yochiyochirb/kajaeru/statuses/7f494454817fa5aa9b5f62d06351cb1a6c25b413","head":{"label":"yochiyochirb:fix/display_user_voted","ref":"fix/display_user_voted","sha":"7f494454817fa5aa9b5f62d06351cb1a6c25b413","user":{"login":"yochiyochirb","id":6112628,"avatar_url":"https://avatars.githubusercontent.com/u/6112628?v=3","gravatar_id":"","url":"https://api.github.com/users/yochiyochirb","html_url":"https://github.com/yochiyochirb","followers_url":"https://api.github.com/users/yochiyochirb/followers","following_url":"https://api.github.com/users/yochiyochirb/following{/other_user}","gists_url":"https://api.github.com/users/yochiyochirb/gists{/gist_id}","starred_url":"https://api.github.com/users/yochiyochirb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yochiyochirb/subscriptions","organizations_url":"https://api.github.com/users/yochiyochirb/orgs","repos_url":"https://api.github.com/users/yochiyochirb/repos","events_url":"https://api.github.com/users/yochiyochirb/events{/privacy}","received_events_url":"https://api.github.com/users/yochiyochirb/received_events","type":"Organization","site_admin":false},"repo":{"id":22510813,"name":"kajaeru","full_name":"yochiyochirb/kajaeru","owner":{"login":"yochiyochirb","id":6112628,"avatar_url":"https://avatars.githubusercontent.com/u/6112628?v=3","gravatar_id":"","url":"https://api.github.com/users/yochiyochirb","html_url":"https://github.com/yochiyochirb","followers_url":"https://api.github.com/users/yochiyochirb/followers","following_url":"https://api.github.com/users/yochiyochirb/following{/other_user}","gists_url":"https://api.github.com/users/yochiyochirb/gists{/gist_id}","starred_url":"https://api.github.com/users/yochiyochirb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yochiyochirb/subscriptions","organizations_url":"https://api.github.com/users/yochiyochirb/orgs","repos_url":"https://api.github.com/users/yochiyochirb/repos","events_url":"https://api.github.com/users/yochiyochirb/events{/privacy}","received_events_url":"https://api.github.com/users/yochiyochirb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yochiyochirb/kajaeru","description":"","fork":false,"url":"https://api.github.com/repos/yochiyochirb/kajaeru","forks_url":"https://api.github.com/repos/yochiyochirb/kajaeru/forks","keys_url":"https://api.github.com/repos/yochiyochirb/kajaeru/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yochiyochirb/kajaeru/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yochiyochirb/kajaeru/teams","hooks_url":"https://api.github.com/repos/yochiyochirb/kajaeru/hooks","issue_events_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/events{/number}","events_url":"https://api.github.com/repos/yochiyochirb/kajaeru/events","assignees_url":"https://api.github.com/repos/yochiyochirb/kajaeru/assignees{/user}","branches_url":"https://api.github.com/repos/yochiyochirb/kajaeru/branches{/branch}","tags_url":"https://api.github.com/repos/yochiyochirb/kajaeru/tags","blobs_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/refs{/sha}","trees_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yochiyochirb/kajaeru/statuses/{sha}","languages_url":"https://api.github.com/repos/yochiyochirb/kajaeru/languages","stargazers_url":"https://api.github.com/repos/yochiyochirb/kajaeru/stargazers","contributors_url":"https://api.github.com/repos/yochiyochirb/kajaeru/contributors","subscribers_url":"https://api.github.com/repos/yochiyochirb/kajaeru/subscribers","subscription_url":"https://api.github.com/repos/yochiyochirb/kajaeru/subscription","commits_url":"https://api.github.com/repos/yochiyochirb/kajaeru/commits{/sha}","git_commits_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/commits{/sha}","comments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/comments{/number}","issue_comment_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/comments{/number}","contents_url":"https://api.github.com/repos/yochiyochirb/kajaeru/contents/{+path}","compare_url":"https://api.github.com/repos/yochiyochirb/kajaeru/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yochiyochirb/kajaeru/merges","archive_url":"https://api.github.com/repos/yochiyochirb/kajaeru/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yochiyochirb/kajaeru/downloads","issues_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues{/number}","pulls_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls{/number}","milestones_url":"https://api.github.com/repos/yochiyochirb/kajaeru/milestones{/number}","notifications_url":"https://api.github.com/repos/yochiyochirb/kajaeru/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yochiyochirb/kajaeru/labels{/name}","releases_url":"https://api.github.com/repos/yochiyochirb/kajaeru/releases{/id}","deployments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/deployments","created_at":"2014-08-01T13:29:32Z","updated_at":"2016-03-10T13:58:29Z","pushed_at":"2016-04-04T11:32:06Z","git_url":"git://github.com/yochiyochirb/kajaeru.git","ssh_url":"git@github.com:yochiyochirb/kajaeru.git","clone_url":"https://github.com/yochiyochirb/kajaeru.git","svn_url":"https://github.com/yochiyochirb/kajaeru","homepage":null,"size":346,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":26,"forks":3,"open_issues":26,"watchers":15,"default_branch":"master"}},"base":{"label":"yochiyochirb:master","ref":"master","sha":"4923ba0b8129545e87d18c61902c1502fa1d2926","user":{"login":"yochiyochirb","id":6112628,"avatar_url":"https://avatars.githubusercontent.com/u/6112628?v=3","gravatar_id":"","url":"https://api.github.com/users/yochiyochirb","html_url":"https://github.com/yochiyochirb","followers_url":"https://api.github.com/users/yochiyochirb/followers","following_url":"https://api.github.com/users/yochiyochirb/following{/other_user}","gists_url":"https://api.github.com/users/yochiyochirb/gists{/gist_id}","starred_url":"https://api.github.com/users/yochiyochirb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yochiyochirb/subscriptions","organizations_url":"https://api.github.com/users/yochiyochirb/orgs","repos_url":"https://api.github.com/users/yochiyochirb/repos","events_url":"https://api.github.com/users/yochiyochirb/events{/privacy}","received_events_url":"https://api.github.com/users/yochiyochirb/received_events","type":"Organization","site_admin":false},"repo":{"id":22510813,"name":"kajaeru","full_name":"yochiyochirb/kajaeru","owner":{"login":"yochiyochirb","id":6112628,"avatar_url":"https://avatars.githubusercontent.com/u/6112628?v=3","gravatar_id":"","url":"https://api.github.com/users/yochiyochirb","html_url":"https://github.com/yochiyochirb","followers_url":"https://api.github.com/users/yochiyochirb/followers","following_url":"https://api.github.com/users/yochiyochirb/following{/other_user}","gists_url":"https://api.github.com/users/yochiyochirb/gists{/gist_id}","starred_url":"https://api.github.com/users/yochiyochirb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yochiyochirb/subscriptions","organizations_url":"https://api.github.com/users/yochiyochirb/orgs","repos_url":"https://api.github.com/users/yochiyochirb/repos","events_url":"https://api.github.com/users/yochiyochirb/events{/privacy}","received_events_url":"https://api.github.com/users/yochiyochirb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yochiyochirb/kajaeru","description":"","fork":false,"url":"https://api.github.com/repos/yochiyochirb/kajaeru","forks_url":"https://api.github.com/repos/yochiyochirb/kajaeru/forks","keys_url":"https://api.github.com/repos/yochiyochirb/kajaeru/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yochiyochirb/kajaeru/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yochiyochirb/kajaeru/teams","hooks_url":"https://api.github.com/repos/yochiyochirb/kajaeru/hooks","issue_events_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/events{/number}","events_url":"https://api.github.com/repos/yochiyochirb/kajaeru/events","assignees_url":"https://api.github.com/repos/yochiyochirb/kajaeru/assignees{/user}","branches_url":"https://api.github.com/repos/yochiyochirb/kajaeru/branches{/branch}","tags_url":"https://api.github.com/repos/yochiyochirb/kajaeru/tags","blobs_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/refs{/sha}","trees_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yochiyochirb/kajaeru/statuses/{sha}","languages_url":"https://api.github.com/repos/yochiyochirb/kajaeru/languages","stargazers_url":"https://api.github.com/repos/yochiyochirb/kajaeru/stargazers","contributors_url":"https://api.github.com/repos/yochiyochirb/kajaeru/contributors","subscribers_url":"https://api.github.com/repos/yochiyochirb/kajaeru/subscribers","subscription_url":"https://api.github.com/repos/yochiyochirb/kajaeru/subscription","commits_url":"https://api.github.com/repos/yochiyochirb/kajaeru/commits{/sha}","git_commits_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/commits{/sha}","comments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/comments{/number}","issue_comment_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/comments{/number}","contents_url":"https://api.github.com/repos/yochiyochirb/kajaeru/contents/{+path}","compare_url":"https://api.github.com/repos/yochiyochirb/kajaeru/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yochiyochirb/kajaeru/merges","archive_url":"https://api.github.com/repos/yochiyochirb/kajaeru/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yochiyochirb/kajaeru/downloads","issues_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues{/number}","pulls_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls{/number}","milestones_url":"https://api.github.com/repos/yochiyochirb/kajaeru/milestones{/number}","notifications_url":"https://api.github.com/repos/yochiyochirb/kajaeru/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yochiyochirb/kajaeru/labels{/name}","releases_url":"https://api.github.com/repos/yochiyochirb/kajaeru/releases{/id}","deployments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/deployments","created_at":"2014-08-01T13:29:32Z","updated_at":"2016-03-10T13:58:29Z","pushed_at":"2016-04-04T11:32:06Z","git_url":"git://github.com/yochiyochirb/kajaeru.git","ssh_url":"git@github.com:yochiyochirb/kajaeru.git","clone_url":"https://github.com/yochiyochirb/kajaeru.git","svn_url":"https://github.com/yochiyochirb/kajaeru","homepage":null,"size":346,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":26,"forks":3,"open_issues":26,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/83"},"html":{"href":"https://github.com/yochiyochirb/kajaeru/pull/83"},"issue":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/83"},"comments":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/83/comments"},"review_comments":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/83/comments"},"review_comment":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/83/commits"},"statuses":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/statuses/7f494454817fa5aa9b5f62d06351cb1a6c25b413"}}}}