{"action":"created","comment":{"url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/comments/295679457","pull_request_review_id":252134538,"id":295679457,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5NTY3OTQ1Nw==","diff_hunk":"@@ -0,0 +1,24 @@\n+class CommentsController < ApplicationController\n+  before_action :set_product\n+\n+  def create\n+    @comment = @product.comments.new(comment_params)\n+    if @comment.save\n+      flash[:notice] = \"コメントを投稿しました\"\n+      redirect_to show_products_path(@product)\n+    else\n+      flash[:alert] = 'コメント投稿が失敗しました。入力内容を確認してください。'\n+      redirect_to show_products_path(@product)\n+    end","path":"app/controllers/comments_controller.rb","position":12,"original_position":12,"commit_id":"cd0656e5f65ab6db58456de11deb617ce975aede","original_commit_id":"cd0656e5f65ab6db58456de11deb617ce975aede","user":{"login":"TOMARUMARU","id":27071603,"node_id":"MDQ6VXNlcjI3MDcxNjAz","avatar_url":"https://avatars1.githubusercontent.com/u/27071603?v=4","gravatar_id":"","url":"https://api.github.com/users/TOMARUMARU","html_url":"https://github.com/TOMARUMARU","followers_url":"https://api.github.com/users/TOMARUMARU/followers","following_url":"https://api.github.com/users/TOMARUMARU/following{/other_user}","gists_url":"https://api.github.com/users/TOMARUMARU/gists{/gist_id}","starred_url":"https://api.github.com/users/TOMARUMARU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TOMARUMARU/subscriptions","organizations_url":"https://api.github.com/users/TOMARUMARU/orgs","repos_url":"https://api.github.com/users/TOMARUMARU/repos","events_url":"https://api.github.com/users/TOMARUMARU/events{/privacy}","received_events_url":"https://api.github.com/users/TOMARUMARU/received_events","type":"User","site_admin":false},"body":"redirectの処理が同じなので\r\n```\r\n@comment.save ? flash[:notice] = \"コメントを投稿しました\" : flash[:alert] = 'コメント投稿が失敗しました。入力内容を確認してください。'\r\nredirect_to show_products_path(@product)\r\n```\r\nでよさそうです","created_at":"2019-06-20T07:39:37Z","updated_at":"2019-06-20T07:40:31Z","html_url":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51/pull/79#discussion_r295679457","pull_request_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/79","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/comments/295679457"},"html":{"href":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51/pull/79#discussion_r295679457"},"pull_request":{"href":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/79"}}},"pull_request":{"url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/79","id":290011141,"node_id":"MDExOlB1bGxSZXF1ZXN0MjkwMDExMTQx","html_url":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51/pull/79","diff_url":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51/pull/79.diff","patch_url":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51/pull/79.patch","issue_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/issues/79","number":79,"state":"open","locked":false,"title":"コメント機能実装","user":{"login":"YousukeSasaki","id":47591155,"node_id":"MDQ6VXNlcjQ3NTkxMTU1","avatar_url":"https://avatars2.githubusercontent.com/u/47591155?v=4","gravatar_id":"","url":"https://api.github.com/users/YousukeSasaki","html_url":"https://github.com/YousukeSasaki","followers_url":"https://api.github.com/users/YousukeSasaki/followers","following_url":"https://api.github.com/users/YousukeSasaki/following{/other_user}","gists_url":"https://api.github.com/users/YousukeSasaki/gists{/gist_id}","starred_url":"https://api.github.com/users/YousukeSasaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YousukeSasaki/subscriptions","organizations_url":"https://api.github.com/users/YousukeSasaki/orgs","repos_url":"https://api.github.com/users/YousukeSasaki/repos","events_url":"https://api.github.com/users/YousukeSasaki/events{/privacy}","received_events_url":"https://api.github.com/users/YousukeSasaki/received_events","type":"User","site_admin":false},"body":"# WHAT\r\n- 商品詳細画面よりコメントできる機能を実装した\r\n\r\n# WHY\r\n- プラスアルファで実装可能な新機能で優先的だったため\r\n\r\n# スクリーンショット\r\n- https://gyazo.com/a61f1c56cf1ab8f6e81a00b51e5b9d4c\r\n- https://gyazo.com/115ffdc951c0c5b1611f0c9e70ef003e","created_at":"2019-06-20T07:35:28Z","updated_at":"2019-06-20T07:40:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25b720f7851ca01d8cd541f056e6df9101e86e84","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/79/commits","review_comments_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/79/comments","review_comment_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/issues/79/comments","statuses_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/statuses/cd0656e5f65ab6db58456de11deb617ce975aede","head":{"label":"tomaaaaaaaaa:comment_view_change","ref":"comment_view_change","sha":"cd0656e5f65ab6db58456de11deb617ce975aede","user":{"login":"tomaaaaaaaaa","id":50260486,"node_id":"MDQ6VXNlcjUwMjYwNDg2","avatar_url":"https://avatars1.githubusercontent.com/u/50260486?v=4","gravatar_id":"","url":"https://api.github.com/users/tomaaaaaaaaa","html_url":"https://github.com/tomaaaaaaaaa","followers_url":"https://api.github.com/users/tomaaaaaaaaa/followers","following_url":"https://api.github.com/users/tomaaaaaaaaa/following{/other_user}","gists_url":"https://api.github.com/users/tomaaaaaaaaa/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaaaaaaaaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaaaaaaaaa/subscriptions","organizations_url":"https://api.github.com/users/tomaaaaaaaaa/orgs","repos_url":"https://api.github.com/users/tomaaaaaaaaa/repos","events_url":"https://api.github.com/users/tomaaaaaaaaa/events{/privacy}","received_events_url":"https://api.github.com/users/tomaaaaaaaaa/received_events","type":"User","site_admin":false},"repo":{"id":188367705,"node_id":"MDEwOlJlcG9zaXRvcnkxODgzNjc3MDU=","name":"Mercari_Nagoya51","full_name":"tomaaaaaaaaa/Mercari_Nagoya51","private":false,"owner":{"login":"tomaaaaaaaaa","id":50260486,"node_id":"MDQ6VXNlcjUwMjYwNDg2","avatar_url":"https://avatars1.githubusercontent.com/u/50260486?v=4","gravatar_id":"","url":"https://api.github.com/users/tomaaaaaaaaa","html_url":"https://github.com/tomaaaaaaaaa","followers_url":"https://api.github.com/users/tomaaaaaaaaa/followers","following_url":"https://api.github.com/users/tomaaaaaaaaa/following{/other_user}","gists_url":"https://api.github.com/users/tomaaaaaaaaa/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaaaaaaaaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaaaaaaaaa/subscriptions","organizations_url":"https://api.github.com/users/tomaaaaaaaaa/orgs","repos_url":"https://api.github.com/users/tomaaaaaaaaa/repos","events_url":"https://api.github.com/users/tomaaaaaaaaa/events{/privacy}","received_events_url":"https://api.github.com/users/tomaaaaaaaaa/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51","description":null,"fork":false,"url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51","forks_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/forks","keys_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/teams","hooks_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/hooks","issue_events_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/issues/events{/number}","events_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/events","assignees_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/assignees{/user}","branches_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/branches{/branch}","tags_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/tags","blobs_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/statuses/{sha}","languages_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/languages","stargazers_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/stargazers","contributors_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/contributors","subscribers_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/subscribers","subscription_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/subscription","commits_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/contents/{+path}","compare_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/merges","archive_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/downloads","issues_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/issues{/number}","pulls_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls{/number}","milestones_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/milestones{/number}","notifications_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/labels{/name}","releases_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/releases{/id}","deployments_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/deployments","created_at":"2019-05-24T06:45:42Z","updated_at":"2019-06-20T07:34:20Z","pushed_at":"2019-06-20T07:39:26Z","git_url":"git://github.com/tomaaaaaaaaa/Mercari_Nagoya51.git","ssh_url":"git@github.com:tomaaaaaaaaa/Mercari_Nagoya51.git","clone_url":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51.git","svn_url":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51","homepage":null,"size":3299,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"tomaaaaaaaaa:master","ref":"master","sha":"6f03c0759f9ad1f9ccac5d08435043d281411b86","user":{"login":"tomaaaaaaaaa","id":50260486,"node_id":"MDQ6VXNlcjUwMjYwNDg2","avatar_url":"https://avatars1.githubusercontent.com/u/50260486?v=4","gravatar_id":"","url":"https://api.github.com/users/tomaaaaaaaaa","html_url":"https://github.com/tomaaaaaaaaa","followers_url":"https://api.github.com/users/tomaaaaaaaaa/followers","following_url":"https://api.github.com/users/tomaaaaaaaaa/following{/other_user}","gists_url":"https://api.github.com/users/tomaaaaaaaaa/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaaaaaaaaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaaaaaaaaa/subscriptions","organizations_url":"https://api.github.com/users/tomaaaaaaaaa/orgs","repos_url":"https://api.github.com/users/tomaaaaaaaaa/repos","events_url":"https://api.github.com/users/tomaaaaaaaaa/events{/privacy}","received_events_url":"https://api.github.com/users/tomaaaaaaaaa/received_events","type":"User","site_admin":false},"repo":{"id":188367705,"node_id":"MDEwOlJlcG9zaXRvcnkxODgzNjc3MDU=","name":"Mercari_Nagoya51","full_name":"tomaaaaaaaaa/Mercari_Nagoya51","private":false,"owner":{"login":"tomaaaaaaaaa","id":50260486,"node_id":"MDQ6VXNlcjUwMjYwNDg2","avatar_url":"https://avatars1.githubusercontent.com/u/50260486?v=4","gravatar_id":"","url":"https://api.github.com/users/tomaaaaaaaaa","html_url":"https://github.com/tomaaaaaaaaa","followers_url":"https://api.github.com/users/tomaaaaaaaaa/followers","following_url":"https://api.github.com/users/tomaaaaaaaaa/following{/other_user}","gists_url":"https://api.github.com/users/tomaaaaaaaaa/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaaaaaaaaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaaaaaaaaa/subscriptions","organizations_url":"https://api.github.com/users/tomaaaaaaaaa/orgs","repos_url":"https://api.github.com/users/tomaaaaaaaaa/repos","events_url":"https://api.github.com/users/tomaaaaaaaaa/events{/privacy}","received_events_url":"https://api.github.com/users/tomaaaaaaaaa/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51","description":null,"fork":false,"url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51","forks_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/forks","keys_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/teams","hooks_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/hooks","issue_events_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/issues/events{/number}","events_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/events","assignees_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/assignees{/user}","branches_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/branches{/branch}","tags_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/tags","blobs_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/statuses/{sha}","languages_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/languages","stargazers_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/stargazers","contributors_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/contributors","subscribers_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/subscribers","subscription_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/subscription","commits_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/contents/{+path}","compare_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/merges","archive_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/downloads","issues_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/issues{/number}","pulls_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls{/number}","milestones_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/milestones{/number}","notifications_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/labels{/name}","releases_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/releases{/id}","deployments_url":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/deployments","created_at":"2019-05-24T06:45:42Z","updated_at":"2019-06-20T07:34:20Z","pushed_at":"2019-06-20T07:39:26Z","git_url":"git://github.com/tomaaaaaaaaa/Mercari_Nagoya51.git","ssh_url":"git@github.com:tomaaaaaaaaa/Mercari_Nagoya51.git","clone_url":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51.git","svn_url":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51","homepage":null,"size":3299,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/79"},"html":{"href":"https://github.com/tomaaaaaaaaa/Mercari_Nagoya51/pull/79"},"issue":{"href":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/issues/79"},"comments":{"href":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/issues/79/comments"},"review_comments":{"href":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/79/comments"},"review_comment":{"href":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/pulls/79/commits"},"statuses":{"href":"https://api.github.com/repos/tomaaaaaaaaa/Mercari_Nagoya51/statuses/cd0656e5f65ab6db58456de11deb617ce975aede"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"TOMARUMARU"}}