{"action":"created","comment":{"url":"https://api.github.com/repos/keisuke713/cities/pulls/comments/320476036","pull_request_review_id":283258378,"id":320476036,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyMDQ3NjAzNg==","diff_hunk":"@@ -0,0 +1,27 @@\n+class BookMarksController < ApplicationController\n+  before_action :logged_in_user\n+","path":"app/controllers/book_marks_controller.rb","position":3,"original_position":3,"commit_id":"b15a9e42046184485a57e1efef02b5166114db4a","original_commit_id":"b15a9e42046184485a57e1efef02b5166114db4a","user":{"login":"keisuke713","id":42457215,"node_id":"MDQ6VXNlcjQyNDU3MjE1","avatar_url":"https://avatars2.githubusercontent.com/u/42457215?v=4","gravatar_id":"","url":"https://api.github.com/users/keisuke713","html_url":"https://github.com/keisuke713","followers_url":"https://api.github.com/users/keisuke713/followers","following_url":"https://api.github.com/users/keisuke713/following{/other_user}","gists_url":"https://api.github.com/users/keisuke713/gists{/gist_id}","starred_url":"https://api.github.com/users/keisuke713/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keisuke713/subscriptions","organizations_url":"https://api.github.com/users/keisuke713/orgs","repos_url":"https://api.github.com/users/keisuke713/repos","events_url":"https://api.github.com/users/keisuke713/events{/privacy}","received_events_url":"https://api.github.com/users/keisuke713/received_events","type":"User","site_admin":false},"body":"viewでもユーザー情報表示させるのでここはインスタンス変数の方がよろしいかと😓\r\n","created_at":"2019-09-03T20:59:50Z","updated_at":"2019-09-03T20:59:50Z","html_url":"https://github.com/keisuke713/cities/pull/9#discussion_r320476036","pull_request_url":"https://api.github.com/repos/keisuke713/cities/pulls/9","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/keisuke713/cities/pulls/comments/320476036"},"html":{"href":"https://github.com/keisuke713/cities/pull/9#discussion_r320476036"},"pull_request":{"href":"https://api.github.com/repos/keisuke713/cities/pulls/9"}},"in_reply_to_id":320221454},"pull_request":{"url":"https://api.github.com/repos/keisuke713/cities/pulls/9","id":311130899,"node_id":"MDExOlB1bGxSZXF1ZXN0MzExMTMwODk5","html_url":"https://github.com/keisuke713/cities/pull/9","diff_url":"https://github.com/keisuke713/cities/pull/9.diff","patch_url":"https://github.com/keisuke713/cities/pull/9.patch","issue_url":"https://api.github.com/repos/keisuke713/cities/issues/9","number":9,"state":"open","locked":false,"title":"implement_bookmark_for_post","user":{"login":"keisuke713","id":42457215,"node_id":"MDQ6VXNlcjQyNDU3MjE1","avatar_url":"https://avatars2.githubusercontent.com/u/42457215?v=4","gravatar_id":"","url":"https://api.github.com/users/keisuke713","html_url":"https://github.com/keisuke713","followers_url":"https://api.github.com/users/keisuke713/followers","following_url":"https://api.github.com/users/keisuke713/following{/other_user}","gists_url":"https://api.github.com/users/keisuke713/gists{/gist_id}","starred_url":"https://api.github.com/users/keisuke713/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keisuke713/subscriptions","organizations_url":"https://api.github.com/users/keisuke713/orgs","repos_url":"https://api.github.com/users/keisuke713/repos","events_url":"https://api.github.com/users/keisuke713/events{/privacy}","received_events_url":"https://api.github.com/users/keisuke713/received_events","type":"User","site_admin":false},"body":"# 概要\r\n\r\n* なぜこの変更をするのか、\r\n* ブックマーク機能を実装することによってユーザーが気に入った投稿について素早くアクセスすることができる\r\n\r\n## 技術的変更点概要\r\n\r\n* Bookmarkテーブルを作成し、そこに現在のユーザーと選択された投稿のIDを保存する\r\n\r\n## UIに対する変更\r\n\r\n・あるユーザーがブックマークした投稿一覧\r\n→https://gyazo.com/4883121ebe8a7f654a495f147a67525f\r\n・ブックマークを一件もしていない場合\r\n→https://gyazo.com/286b50fd18ba927c6b05c78fbb354840\r\n・ブックマークをしている投稿\r\n→https://gyazo.com/48c357cae89e42d2b776aaf3b8621799\r\n・ブックマークをしていない投稿\r\n→https://gyazo.com/d8b8ba31713feabf570a2a1d140f0c67\r\n\r\n\r\n## マイグレーション\r\n\r\n```sql\r\nCREATE TABLE IF NOT EXISTS \"book_marks\" (\"id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, \"user_id\" integer NOT NULL, \"post_id\" integer NOT NULL, \"created_at\" datetime NOT NULL, \"updated_at\" datetime NOT N\r\nULL, CONSTRAINT \"fk_rails_881e48cf56\"\r\nFOREIGN KEY (\"user_id\")\r\n  REFERENCES \"users\" (\"id\")\r\n, CONSTRAINT \"fk_rails_34f30bead1\"\r\nFOREIGN KEY (\"post_id\")\r\n  REFERENCES \"posts\" (\"id\")\r\n);\r\n```\r\n\r\n## テスト結果とテスト項目\r\n\r\n* Userモデル\r\n* [x] ユーザーを削除した時BookMarkテーブルから紐づくレコードを削除する\r\n* Postモデル\r\n* [x] 投稿を削除した時BookMarkテーブルから紐づくレコードを削除する\r\n* bookmarks_controller#index\r\n* [x] ステータスコード200が返ってくる\r\n* [x] ユーザーがブックマークした投稿を全て取得する\r\n* [x] indexテンプレートを表示させる\r\n* bookmarks_controller#create\r\n* [x] ステータスコード200が返ってくる\r\n* [x] BookMarkデータが1件増加する\r\n* [x] 元のページにリダイレクトされる\r\n* bookmarks_controller#destroy\r\n* [x] ステータスコード200が返ってくる\r\n* [x] BookMarkデータが1件減少する\r\n* [x] 元のページにリダイレクトする\r\n\r\n## 今回保留した項目とTODOリスト\r\n\r\n* ユーザーフォロー機能\r\n* フォロワーへDMを送る機能\r\n* ページ表示の高速化\r\n* テストの高速化\r\n","created_at":"2019-08-26T23:07:24Z","updated_at":"2019-09-03T20:59:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c9e4b93f55a402d1f15bdae49e203e11f15f528","assignee":{"login":"yu-croco","id":30188755,"node_id":"MDQ6VXNlcjMwMTg4NzU1","avatar_url":"https://avatars2.githubusercontent.com/u/30188755?v=4","gravatar_id":"","url":"https://api.github.com/users/yu-croco","html_url":"https://github.com/yu-croco","followers_url":"https://api.github.com/users/yu-croco/followers","following_url":"https://api.github.com/users/yu-croco/following{/other_user}","gists_url":"https://api.github.com/users/yu-croco/gists{/gist_id}","starred_url":"https://api.github.com/users/yu-croco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yu-croco/subscriptions","organizations_url":"https://api.github.com/users/yu-croco/orgs","repos_url":"https://api.github.com/users/yu-croco/repos","events_url":"https://api.github.com/users/yu-croco/events{/privacy}","received_events_url":"https://api.github.com/users/yu-croco/received_events","type":"User","site_admin":false},"assignees":[{"login":"yu-croco","id":30188755,"node_id":"MDQ6VXNlcjMwMTg4NzU1","avatar_url":"https://avatars2.githubusercontent.com/u/30188755?v=4","gravatar_id":"","url":"https://api.github.com/users/yu-croco","html_url":"https://github.com/yu-croco","followers_url":"https://api.github.com/users/yu-croco/followers","following_url":"https://api.github.com/users/yu-croco/following{/other_user}","gists_url":"https://api.github.com/users/yu-croco/gists{/gist_id}","starred_url":"https://api.github.com/users/yu-croco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yu-croco/subscriptions","organizations_url":"https://api.github.com/users/yu-croco/orgs","repos_url":"https://api.github.com/users/yu-croco/repos","events_url":"https://api.github.com/users/yu-croco/events{/privacy}","received_events_url":"https://api.github.com/users/yu-croco/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/keisuke713/cities/pulls/9/commits","review_comments_url":"https://api.github.com/repos/keisuke713/cities/pulls/9/comments","review_comment_url":"https://api.github.com/repos/keisuke713/cities/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keisuke713/cities/issues/9/comments","statuses_url":"https://api.github.com/repos/keisuke713/cities/statuses/b15a9e42046184485a57e1efef02b5166114db4a","head":{"label":"keisuke713:implement_bookmark_for_post","ref":"implement_bookmark_for_post","sha":"b15a9e42046184485a57e1efef02b5166114db4a","user":{"login":"keisuke713","id":42457215,"node_id":"MDQ6VXNlcjQyNDU3MjE1","avatar_url":"https://avatars2.githubusercontent.com/u/42457215?v=4","gravatar_id":"","url":"https://api.github.com/users/keisuke713","html_url":"https://github.com/keisuke713","followers_url":"https://api.github.com/users/keisuke713/followers","following_url":"https://api.github.com/users/keisuke713/following{/other_user}","gists_url":"https://api.github.com/users/keisuke713/gists{/gist_id}","starred_url":"https://api.github.com/users/keisuke713/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keisuke713/subscriptions","organizations_url":"https://api.github.com/users/keisuke713/orgs","repos_url":"https://api.github.com/users/keisuke713/repos","events_url":"https://api.github.com/users/keisuke713/events{/privacy}","received_events_url":"https://api.github.com/users/keisuke713/received_events","type":"User","site_admin":false},"repo":{"id":196696067,"node_id":"MDEwOlJlcG9zaXRvcnkxOTY2OTYwNjc=","name":"cities","full_name":"keisuke713/cities","private":false,"owner":{"login":"keisuke713","id":42457215,"node_id":"MDQ6VXNlcjQyNDU3MjE1","avatar_url":"https://avatars2.githubusercontent.com/u/42457215?v=4","gravatar_id":"","url":"https://api.github.com/users/keisuke713","html_url":"https://github.com/keisuke713","followers_url":"https://api.github.com/users/keisuke713/followers","following_url":"https://api.github.com/users/keisuke713/following{/other_user}","gists_url":"https://api.github.com/users/keisuke713/gists{/gist_id}","starred_url":"https://api.github.com/users/keisuke713/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keisuke713/subscriptions","organizations_url":"https://api.github.com/users/keisuke713/orgs","repos_url":"https://api.github.com/users/keisuke713/repos","events_url":"https://api.github.com/users/keisuke713/events{/privacy}","received_events_url":"https://api.github.com/users/keisuke713/received_events","type":"User","site_admin":false},"html_url":"https://github.com/keisuke713/cities","description":null,"fork":false,"url":"https://api.github.com/repos/keisuke713/cities","forks_url":"https://api.github.com/repos/keisuke713/cities/forks","keys_url":"https://api.github.com/repos/keisuke713/cities/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keisuke713/cities/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keisuke713/cities/teams","hooks_url":"https://api.github.com/repos/keisuke713/cities/hooks","issue_events_url":"https://api.github.com/repos/keisuke713/cities/issues/events{/number}","events_url":"https://api.github.com/repos/keisuke713/cities/events","assignees_url":"https://api.github.com/repos/keisuke713/cities/assignees{/user}","branches_url":"https://api.github.com/repos/keisuke713/cities/branches{/branch}","tags_url":"https://api.github.com/repos/keisuke713/cities/tags","blobs_url":"https://api.github.com/repos/keisuke713/cities/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keisuke713/cities/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keisuke713/cities/git/refs{/sha}","trees_url":"https://api.github.com/repos/keisuke713/cities/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keisuke713/cities/statuses/{sha}","languages_url":"https://api.github.com/repos/keisuke713/cities/languages","stargazers_url":"https://api.github.com/repos/keisuke713/cities/stargazers","contributors_url":"https://api.github.com/repos/keisuke713/cities/contributors","subscribers_url":"https://api.github.com/repos/keisuke713/cities/subscribers","subscription_url":"https://api.github.com/repos/keisuke713/cities/subscription","commits_url":"https://api.github.com/repos/keisuke713/cities/commits{/sha}","git_commits_url":"https://api.github.com/repos/keisuke713/cities/git/commits{/sha}","comments_url":"https://api.github.com/repos/keisuke713/cities/comments{/number}","issue_comment_url":"https://api.github.com/repos/keisuke713/cities/issues/comments{/number}","contents_url":"https://api.github.com/repos/keisuke713/cities/contents/{+path}","compare_url":"https://api.github.com/repos/keisuke713/cities/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keisuke713/cities/merges","archive_url":"https://api.github.com/repos/keisuke713/cities/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keisuke713/cities/downloads","issues_url":"https://api.github.com/repos/keisuke713/cities/issues{/number}","pulls_url":"https://api.github.com/repos/keisuke713/cities/pulls{/number}","milestones_url":"https://api.github.com/repos/keisuke713/cities/milestones{/number}","notifications_url":"https://api.github.com/repos/keisuke713/cities/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keisuke713/cities/labels{/name}","releases_url":"https://api.github.com/repos/keisuke713/cities/releases{/id}","deployments_url":"https://api.github.com/repos/keisuke713/cities/deployments","created_at":"2019-07-13T08:10:37Z","updated_at":"2019-08-25T09:45:01Z","pushed_at":"2019-09-02T22:15:54Z","git_url":"git://github.com/keisuke713/cities.git","ssh_url":"git@github.com:keisuke713/cities.git","clone_url":"https://github.com/keisuke713/cities.git","svn_url":"https://github.com/keisuke713/cities","homepage":null,"size":264,"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":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"keisuke713:master","ref":"master","sha":"bb290ebb062a7c81c2e2876e51621c0f90ac2a41","user":{"login":"keisuke713","id":42457215,"node_id":"MDQ6VXNlcjQyNDU3MjE1","avatar_url":"https://avatars2.githubusercontent.com/u/42457215?v=4","gravatar_id":"","url":"https://api.github.com/users/keisuke713","html_url":"https://github.com/keisuke713","followers_url":"https://api.github.com/users/keisuke713/followers","following_url":"https://api.github.com/users/keisuke713/following{/other_user}","gists_url":"https://api.github.com/users/keisuke713/gists{/gist_id}","starred_url":"https://api.github.com/users/keisuke713/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keisuke713/subscriptions","organizations_url":"https://api.github.com/users/keisuke713/orgs","repos_url":"https://api.github.com/users/keisuke713/repos","events_url":"https://api.github.com/users/keisuke713/events{/privacy}","received_events_url":"https://api.github.com/users/keisuke713/received_events","type":"User","site_admin":false},"repo":{"id":196696067,"node_id":"MDEwOlJlcG9zaXRvcnkxOTY2OTYwNjc=","name":"cities","full_name":"keisuke713/cities","private":false,"owner":{"login":"keisuke713","id":42457215,"node_id":"MDQ6VXNlcjQyNDU3MjE1","avatar_url":"https://avatars2.githubusercontent.com/u/42457215?v=4","gravatar_id":"","url":"https://api.github.com/users/keisuke713","html_url":"https://github.com/keisuke713","followers_url":"https://api.github.com/users/keisuke713/followers","following_url":"https://api.github.com/users/keisuke713/following{/other_user}","gists_url":"https://api.github.com/users/keisuke713/gists{/gist_id}","starred_url":"https://api.github.com/users/keisuke713/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keisuke713/subscriptions","organizations_url":"https://api.github.com/users/keisuke713/orgs","repos_url":"https://api.github.com/users/keisuke713/repos","events_url":"https://api.github.com/users/keisuke713/events{/privacy}","received_events_url":"https://api.github.com/users/keisuke713/received_events","type":"User","site_admin":false},"html_url":"https://github.com/keisuke713/cities","description":null,"fork":false,"url":"https://api.github.com/repos/keisuke713/cities","forks_url":"https://api.github.com/repos/keisuke713/cities/forks","keys_url":"https://api.github.com/repos/keisuke713/cities/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keisuke713/cities/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keisuke713/cities/teams","hooks_url":"https://api.github.com/repos/keisuke713/cities/hooks","issue_events_url":"https://api.github.com/repos/keisuke713/cities/issues/events{/number}","events_url":"https://api.github.com/repos/keisuke713/cities/events","assignees_url":"https://api.github.com/repos/keisuke713/cities/assignees{/user}","branches_url":"https://api.github.com/repos/keisuke713/cities/branches{/branch}","tags_url":"https://api.github.com/repos/keisuke713/cities/tags","blobs_url":"https://api.github.com/repos/keisuke713/cities/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keisuke713/cities/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keisuke713/cities/git/refs{/sha}","trees_url":"https://api.github.com/repos/keisuke713/cities/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keisuke713/cities/statuses/{sha}","languages_url":"https://api.github.com/repos/keisuke713/cities/languages","stargazers_url":"https://api.github.com/repos/keisuke713/cities/stargazers","contributors_url":"https://api.github.com/repos/keisuke713/cities/contributors","subscribers_url":"https://api.github.com/repos/keisuke713/cities/subscribers","subscription_url":"https://api.github.com/repos/keisuke713/cities/subscription","commits_url":"https://api.github.com/repos/keisuke713/cities/commits{/sha}","git_commits_url":"https://api.github.com/repos/keisuke713/cities/git/commits{/sha}","comments_url":"https://api.github.com/repos/keisuke713/cities/comments{/number}","issue_comment_url":"https://api.github.com/repos/keisuke713/cities/issues/comments{/number}","contents_url":"https://api.github.com/repos/keisuke713/cities/contents/{+path}","compare_url":"https://api.github.com/repos/keisuke713/cities/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keisuke713/cities/merges","archive_url":"https://api.github.com/repos/keisuke713/cities/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keisuke713/cities/downloads","issues_url":"https://api.github.com/repos/keisuke713/cities/issues{/number}","pulls_url":"https://api.github.com/repos/keisuke713/cities/pulls{/number}","milestones_url":"https://api.github.com/repos/keisuke713/cities/milestones{/number}","notifications_url":"https://api.github.com/repos/keisuke713/cities/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keisuke713/cities/labels{/name}","releases_url":"https://api.github.com/repos/keisuke713/cities/releases{/id}","deployments_url":"https://api.github.com/repos/keisuke713/cities/deployments","created_at":"2019-07-13T08:10:37Z","updated_at":"2019-08-25T09:45:01Z","pushed_at":"2019-09-02T22:15:54Z","git_url":"git://github.com/keisuke713/cities.git","ssh_url":"git@github.com:keisuke713/cities.git","clone_url":"https://github.com/keisuke713/cities.git","svn_url":"https://github.com/keisuke713/cities","homepage":null,"size":264,"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":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keisuke713/cities/pulls/9"},"html":{"href":"https://github.com/keisuke713/cities/pull/9"},"issue":{"href":"https://api.github.com/repos/keisuke713/cities/issues/9"},"comments":{"href":"https://api.github.com/repos/keisuke713/cities/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/keisuke713/cities/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/keisuke713/cities/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keisuke713/cities/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/keisuke713/cities/statuses/b15a9e42046184485a57e1efef02b5166114db4a"}},"author_association":"OWNER"}}
{"actor":{"display_login":"keisuke713"}}