{"action":"created","comment":{"url":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/comments/216235203","pull_request_review_id":153665549,"id":216235203,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNjIzNTIwMw==","diff_hunk":"@@ -1,45 +1,65 @@\n class PostsController < ApplicationController\n+  before_action :logged_in_user, only: [:create, :destroy] \n+  before_action :correct_user,   only: :destroy\n+ \n   def index\n-    @posts=Post.all.order(created_at: :desc)\n+    @posts=Post.all\n   end\n \n   def show\n-    @post = Post.find_by(id:params[:id])\n+    @post = Post.find(params[:id])\n+    @comment = Comment.new\n+    @comments = @post.comments\n   end\n \n   def new\n     @post=Post.new\n   end\n \n-  def edit\n-    @post=Post.find_by(id: params[:id])\n-  end \n-\n   def create\n-    @post=Post.new(content: params[:content])\n+    @post= current_user.posts.build(post_params)","path":"app/controllers/posts_controller.rb","position":27,"original_position":27,"commit_id":"01a4ef8e0d242d1f404d78e8d88645598381c679","original_commit_id":"01a4ef8e0d242d1f404d78e8d88645598381c679","user":{"login":"takahiromorooka","id":31618126,"node_id":"MDQ6VXNlcjMxNjE4MTI2","avatar_url":"https://avatars2.githubusercontent.com/u/31618126?v=4","gravatar_id":"","url":"https://api.github.com/users/takahiromorooka","html_url":"https://github.com/takahiromorooka","followers_url":"https://api.github.com/users/takahiromorooka/followers","following_url":"https://api.github.com/users/takahiromorooka/following{/other_user}","gists_url":"https://api.github.com/users/takahiromorooka/gists{/gist_id}","starred_url":"https://api.github.com/users/takahiromorooka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takahiromorooka/subscriptions","organizations_url":"https://api.github.com/users/takahiromorooka/orgs","repos_url":"https://api.github.com/users/takahiromorooka/repos","events_url":"https://api.github.com/users/takahiromorooka/events{/privacy}","received_events_url":"https://api.github.com/users/takahiromorooka/received_events","type":"User","site_admin":false},"body":"@post = current_user.posts.build(post_params)\r\n\r\nbuildじゃなくてcreate使ってあげよう","created_at":"2018-09-10T08:25:22Z","updated_at":"2018-09-10T08:42:27Z","html_url":"https://github.com/takaykuki0310/twitter_app/pull/1#discussion_r216235203","pull_request_url":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/comments/216235203"},"html":{"href":"https://github.com/takaykuki0310/twitter_app/pull/1#discussion_r216235203"},"pull_request":{"href":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/1","id":213825657,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzODI1NjU3","html_url":"https://github.com/takaykuki0310/twitter_app/pull/1","diff_url":"https://github.com/takaykuki0310/twitter_app/pull/1.diff","patch_url":"https://github.com/takaykuki0310/twitter_app/pull/1.patch","issue_url":"https://api.github.com/repos/takaykuki0310/twitter_app/issues/1","number":1,"state":"open","locked":false,"title":"comment_pullrequest","user":{"login":"sinn22","id":39830040,"node_id":"MDQ6VXNlcjM5ODMwMDQw","avatar_url":"https://avatars2.githubusercontent.com/u/39830040?v=4","gravatar_id":"","url":"https://api.github.com/users/sinn22","html_url":"https://github.com/sinn22","followers_url":"https://api.github.com/users/sinn22/followers","following_url":"https://api.github.com/users/sinn22/following{/other_user}","gists_url":"https://api.github.com/users/sinn22/gists{/gist_id}","starred_url":"https://api.github.com/users/sinn22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinn22/subscriptions","organizations_url":"https://api.github.com/users/sinn22/orgs","repos_url":"https://api.github.com/users/sinn22/repos","events_url":"https://api.github.com/users/sinn22/events{/privacy}","received_events_url":"https://api.github.com/users/sinn22/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-07T06:09:52Z","updated_at":"2018-09-10T08:42:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fda5f54f7d956e3dac0faa3ad13c04a4b9ac1d9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/1/commits","review_comments_url":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/1/comments","review_comment_url":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/takaykuki0310/twitter_app/issues/1/comments","statuses_url":"https://api.github.com/repos/takaykuki0310/twitter_app/statuses/01a4ef8e0d242d1f404d78e8d88645598381c679","head":{"label":"takaykuki0310:master","ref":"master","sha":"01a4ef8e0d242d1f404d78e8d88645598381c679","user":{"login":"takaykuki0310","id":29591168,"node_id":"MDQ6VXNlcjI5NTkxMTY4","avatar_url":"https://avatars3.githubusercontent.com/u/29591168?v=4","gravatar_id":"","url":"https://api.github.com/users/takaykuki0310","html_url":"https://github.com/takaykuki0310","followers_url":"https://api.github.com/users/takaykuki0310/followers","following_url":"https://api.github.com/users/takaykuki0310/following{/other_user}","gists_url":"https://api.github.com/users/takaykuki0310/gists{/gist_id}","starred_url":"https://api.github.com/users/takaykuki0310/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takaykuki0310/subscriptions","organizations_url":"https://api.github.com/users/takaykuki0310/orgs","repos_url":"https://api.github.com/users/takaykuki0310/repos","events_url":"https://api.github.com/users/takaykuki0310/events{/privacy}","received_events_url":"https://api.github.com/users/takaykuki0310/received_events","type":"User","site_admin":false},"repo":{"id":145419207,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU0MTkyMDc=","name":"twitter_app","full_name":"takaykuki0310/twitter_app","owner":{"login":"takaykuki0310","id":29591168,"node_id":"MDQ6VXNlcjI5NTkxMTY4","avatar_url":"https://avatars3.githubusercontent.com/u/29591168?v=4","gravatar_id":"","url":"https://api.github.com/users/takaykuki0310","html_url":"https://github.com/takaykuki0310","followers_url":"https://api.github.com/users/takaykuki0310/followers","following_url":"https://api.github.com/users/takaykuki0310/following{/other_user}","gists_url":"https://api.github.com/users/takaykuki0310/gists{/gist_id}","starred_url":"https://api.github.com/users/takaykuki0310/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takaykuki0310/subscriptions","organizations_url":"https://api.github.com/users/takaykuki0310/orgs","repos_url":"https://api.github.com/users/takaykuki0310/repos","events_url":"https://api.github.com/users/takaykuki0310/events{/privacy}","received_events_url":"https://api.github.com/users/takaykuki0310/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/takaykuki0310/twitter_app","description":null,"fork":false,"url":"https://api.github.com/repos/takaykuki0310/twitter_app","forks_url":"https://api.github.com/repos/takaykuki0310/twitter_app/forks","keys_url":"https://api.github.com/repos/takaykuki0310/twitter_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/takaykuki0310/twitter_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/takaykuki0310/twitter_app/teams","hooks_url":"https://api.github.com/repos/takaykuki0310/twitter_app/hooks","issue_events_url":"https://api.github.com/repos/takaykuki0310/twitter_app/issues/events{/number}","events_url":"https://api.github.com/repos/takaykuki0310/twitter_app/events","assignees_url":"https://api.github.com/repos/takaykuki0310/twitter_app/assignees{/user}","branches_url":"https://api.github.com/repos/takaykuki0310/twitter_app/branches{/branch}","tags_url":"https://api.github.com/repos/takaykuki0310/twitter_app/tags","blobs_url":"https://api.github.com/repos/takaykuki0310/twitter_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/takaykuki0310/twitter_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/takaykuki0310/twitter_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/takaykuki0310/twitter_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/takaykuki0310/twitter_app/statuses/{sha}","languages_url":"https://api.github.com/repos/takaykuki0310/twitter_app/languages","stargazers_url":"https://api.github.com/repos/takaykuki0310/twitter_app/stargazers","contributors_url":"https://api.github.com/repos/takaykuki0310/twitter_app/contributors","subscribers_url":"https://api.github.com/repos/takaykuki0310/twitter_app/subscribers","subscription_url":"https://api.github.com/repos/takaykuki0310/twitter_app/subscription","commits_url":"https://api.github.com/repos/takaykuki0310/twitter_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/takaykuki0310/twitter_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/takaykuki0310/twitter_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/takaykuki0310/twitter_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/takaykuki0310/twitter_app/contents/{+path}","compare_url":"https://api.github.com/repos/takaykuki0310/twitter_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/takaykuki0310/twitter_app/merges","archive_url":"https://api.github.com/repos/takaykuki0310/twitter_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/takaykuki0310/twitter_app/downloads","issues_url":"https://api.github.com/repos/takaykuki0310/twitter_app/issues{/number}","pulls_url":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls{/number}","milestones_url":"https://api.github.com/repos/takaykuki0310/twitter_app/milestones{/number}","notifications_url":"https://api.github.com/repos/takaykuki0310/twitter_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/takaykuki0310/twitter_app/labels{/name}","releases_url":"https://api.github.com/repos/takaykuki0310/twitter_app/releases{/id}","deployments_url":"https://api.github.com/repos/takaykuki0310/twitter_app/deployments","created_at":"2018-08-20T13:09:46Z","updated_at":"2018-09-08T07:29:38Z","pushed_at":"2018-09-08T07:29:37Z","git_url":"git://github.com/takaykuki0310/twitter_app.git","ssh_url":"git@github.com:takaykuki0310/twitter_app.git","clone_url":"https://github.com/takaykuki0310/twitter_app.git","svn_url":"https://github.com/takaykuki0310/twitter_app","homepage":null,"size":32229,"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":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"takaykuki0310:validation-flashmessages","ref":"validation-flashmessages","sha":"2980ed284ac90cba3e444f2670f3dc276ba39f56","user":{"login":"takaykuki0310","id":29591168,"node_id":"MDQ6VXNlcjI5NTkxMTY4","avatar_url":"https://avatars3.githubusercontent.com/u/29591168?v=4","gravatar_id":"","url":"https://api.github.com/users/takaykuki0310","html_url":"https://github.com/takaykuki0310","followers_url":"https://api.github.com/users/takaykuki0310/followers","following_url":"https://api.github.com/users/takaykuki0310/following{/other_user}","gists_url":"https://api.github.com/users/takaykuki0310/gists{/gist_id}","starred_url":"https://api.github.com/users/takaykuki0310/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takaykuki0310/subscriptions","organizations_url":"https://api.github.com/users/takaykuki0310/orgs","repos_url":"https://api.github.com/users/takaykuki0310/repos","events_url":"https://api.github.com/users/takaykuki0310/events{/privacy}","received_events_url":"https://api.github.com/users/takaykuki0310/received_events","type":"User","site_admin":false},"repo":{"id":145419207,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU0MTkyMDc=","name":"twitter_app","full_name":"takaykuki0310/twitter_app","owner":{"login":"takaykuki0310","id":29591168,"node_id":"MDQ6VXNlcjI5NTkxMTY4","avatar_url":"https://avatars3.githubusercontent.com/u/29591168?v=4","gravatar_id":"","url":"https://api.github.com/users/takaykuki0310","html_url":"https://github.com/takaykuki0310","followers_url":"https://api.github.com/users/takaykuki0310/followers","following_url":"https://api.github.com/users/takaykuki0310/following{/other_user}","gists_url":"https://api.github.com/users/takaykuki0310/gists{/gist_id}","starred_url":"https://api.github.com/users/takaykuki0310/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takaykuki0310/subscriptions","organizations_url":"https://api.github.com/users/takaykuki0310/orgs","repos_url":"https://api.github.com/users/takaykuki0310/repos","events_url":"https://api.github.com/users/takaykuki0310/events{/privacy}","received_events_url":"https://api.github.com/users/takaykuki0310/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/takaykuki0310/twitter_app","description":null,"fork":false,"url":"https://api.github.com/repos/takaykuki0310/twitter_app","forks_url":"https://api.github.com/repos/takaykuki0310/twitter_app/forks","keys_url":"https://api.github.com/repos/takaykuki0310/twitter_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/takaykuki0310/twitter_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/takaykuki0310/twitter_app/teams","hooks_url":"https://api.github.com/repos/takaykuki0310/twitter_app/hooks","issue_events_url":"https://api.github.com/repos/takaykuki0310/twitter_app/issues/events{/number}","events_url":"https://api.github.com/repos/takaykuki0310/twitter_app/events","assignees_url":"https://api.github.com/repos/takaykuki0310/twitter_app/assignees{/user}","branches_url":"https://api.github.com/repos/takaykuki0310/twitter_app/branches{/branch}","tags_url":"https://api.github.com/repos/takaykuki0310/twitter_app/tags","blobs_url":"https://api.github.com/repos/takaykuki0310/twitter_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/takaykuki0310/twitter_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/takaykuki0310/twitter_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/takaykuki0310/twitter_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/takaykuki0310/twitter_app/statuses/{sha}","languages_url":"https://api.github.com/repos/takaykuki0310/twitter_app/languages","stargazers_url":"https://api.github.com/repos/takaykuki0310/twitter_app/stargazers","contributors_url":"https://api.github.com/repos/takaykuki0310/twitter_app/contributors","subscribers_url":"https://api.github.com/repos/takaykuki0310/twitter_app/subscribers","subscription_url":"https://api.github.com/repos/takaykuki0310/twitter_app/subscription","commits_url":"https://api.github.com/repos/takaykuki0310/twitter_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/takaykuki0310/twitter_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/takaykuki0310/twitter_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/takaykuki0310/twitter_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/takaykuki0310/twitter_app/contents/{+path}","compare_url":"https://api.github.com/repos/takaykuki0310/twitter_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/takaykuki0310/twitter_app/merges","archive_url":"https://api.github.com/repos/takaykuki0310/twitter_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/takaykuki0310/twitter_app/downloads","issues_url":"https://api.github.com/repos/takaykuki0310/twitter_app/issues{/number}","pulls_url":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls{/number}","milestones_url":"https://api.github.com/repos/takaykuki0310/twitter_app/milestones{/number}","notifications_url":"https://api.github.com/repos/takaykuki0310/twitter_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/takaykuki0310/twitter_app/labels{/name}","releases_url":"https://api.github.com/repos/takaykuki0310/twitter_app/releases{/id}","deployments_url":"https://api.github.com/repos/takaykuki0310/twitter_app/deployments","created_at":"2018-08-20T13:09:46Z","updated_at":"2018-09-08T07:29:38Z","pushed_at":"2018-09-08T07:29:37Z","git_url":"git://github.com/takaykuki0310/twitter_app.git","ssh_url":"git@github.com:takaykuki0310/twitter_app.git","clone_url":"https://github.com/takaykuki0310/twitter_app.git","svn_url":"https://github.com/takaykuki0310/twitter_app","homepage":null,"size":32229,"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":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/1"},"html":{"href":"https://github.com/takaykuki0310/twitter_app/pull/1"},"issue":{"href":"https://api.github.com/repos/takaykuki0310/twitter_app/issues/1"},"comments":{"href":"https://api.github.com/repos/takaykuki0310/twitter_app/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/takaykuki0310/twitter_app/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/takaykuki0310/twitter_app/statuses/01a4ef8e0d242d1f404d78e8d88645598381c679"}},"author_association":"NONE"}}
{"actor":{"display_login":"takahiromorooka"}}