{"action":"created","comment":{"url":"https://api.github.com/repos/keita1994/chat-space/pulls/comments/230546425","pull_request_review_id":171317952,"id":230546425,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDU0NjQyNQ==","diff_hunk":"@@ -22,3 +22,62 @@ Things you may want to cover:\n * Deployment instructions\n \n * ...\n+\n+# DB設計\n+\n+## usersテーブル\n+|Column|Type|Options|\n+|------|----|-------|\n+|id|integer|primary_key: true|\n+|name|string|null: false|\n+|email|string|null: false, unique: true|\n+|password|string|null: false|\n+\n+### Association\n+- has_many :groups, through: :members\n+- has_many :members\n+- has_many :messages\n+\n+\n+\n+\n+## groupテーブル\n+|Column|Type|Options|\n+|------|----|-------|\n+|id|integer|primary_key: true|\n+|name|integer|null: false|\n+\n+### Association\n+- has_many :users, through: :members\n+- has_many :members","path":"README.md","position":31,"original_position":31,"commit_id":"071c6c56dce1c17b8430561cbeaa6b88f5425f3d","original_commit_id":"071c6c56dce1c17b8430561cbeaa6b88f5425f3d","user":{"login":"kohei-isoda","id":33193077,"node_id":"MDQ6VXNlcjMzMTkzMDc3","avatar_url":"https://avatars3.githubusercontent.com/u/33193077?v=4","gravatar_id":"","url":"https://api.github.com/users/kohei-isoda","html_url":"https://github.com/kohei-isoda","followers_url":"https://api.github.com/users/kohei-isoda/followers","following_url":"https://api.github.com/users/kohei-isoda/following{/other_user}","gists_url":"https://api.github.com/users/kohei-isoda/gists{/gist_id}","starred_url":"https://api.github.com/users/kohei-isoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kohei-isoda/subscriptions","organizations_url":"https://api.github.com/users/kohei-isoda/orgs","repos_url":"https://api.github.com/users/kohei-isoda/repos","events_url":"https://api.github.com/users/kohei-isoda/events{/privacy}","received_events_url":"https://api.github.com/users/kohei-isoda/received_events","type":"User","site_admin":false},"body":"直前の行でthroughオプションを使ってmembersテーブルを指定していると思うのですが、その前にmembersテーブル自体の定義（has_many :members）が必要になります。コードは上から読まれると言う性質を頭の片隅に入れておきましょう。","created_at":"2018-11-03T06:15:21Z","updated_at":"2018-11-03T06:16:38Z","html_url":"https://github.com/keita1994/chat-space/pull/1#discussion_r230546425","pull_request_url":"https://api.github.com/repos/keita1994/chat-space/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/keita1994/chat-space/pulls/comments/230546425"},"html":{"href":"https://github.com/keita1994/chat-space/pull/1#discussion_r230546425"},"pull_request":{"href":"https://api.github.com/repos/keita1994/chat-space/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/keita1994/chat-space/pulls/1","id":228102131,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MTAyMTMx","html_url":"https://github.com/keita1994/chat-space/pull/1","diff_url":"https://github.com/keita1994/chat-space/pull/1.diff","patch_url":"https://github.com/keita1994/chat-space/pull/1.patch","issue_url":"https://api.github.com/repos/keita1994/chat-space/issues/1","number":1,"state":"open","locked":false,"title":"Edit Readme to make db design","user":{"login":"keita1994","id":44360152,"node_id":"MDQ6VXNlcjQ0MzYwMTUy","avatar_url":"https://avatars3.githubusercontent.com/u/44360152?v=4","gravatar_id":"","url":"https://api.github.com/users/keita1994","html_url":"https://github.com/keita1994","followers_url":"https://api.github.com/users/keita1994/followers","following_url":"https://api.github.com/users/keita1994/following{/other_user}","gists_url":"https://api.github.com/users/keita1994/gists{/gist_id}","starred_url":"https://api.github.com/users/keita1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keita1994/subscriptions","organizations_url":"https://api.github.com/users/keita1994/orgs","repos_url":"https://api.github.com/users/keita1994/repos","events_url":"https://api.github.com/users/keita1994/events{/privacy}","received_events_url":"https://api.github.com/users/keita1994/received_events","type":"User","site_admin":false},"body":"# What\r\nchat spase のデータベース設計を作成\r\n\r\n# Why\r\nサービスを作る上の基本設計であるため","created_at":"2018-11-03T06:05:35Z","updated_at":"2018-11-03T06:16:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a78e991c2d2a8a0281ba0ff0de5150715d5d204","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/keita1994/chat-space/pulls/1/commits","review_comments_url":"https://api.github.com/repos/keita1994/chat-space/pulls/1/comments","review_comment_url":"https://api.github.com/repos/keita1994/chat-space/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keita1994/chat-space/issues/1/comments","statuses_url":"https://api.github.com/repos/keita1994/chat-space/statuses/071c6c56dce1c17b8430561cbeaa6b88f5425f3d","head":{"label":"keita1994:edit_readme_to_make_db_design","ref":"edit_readme_to_make_db_design","sha":"071c6c56dce1c17b8430561cbeaa6b88f5425f3d","user":{"login":"keita1994","id":44360152,"node_id":"MDQ6VXNlcjQ0MzYwMTUy","avatar_url":"https://avatars3.githubusercontent.com/u/44360152?v=4","gravatar_id":"","url":"https://api.github.com/users/keita1994","html_url":"https://github.com/keita1994","followers_url":"https://api.github.com/users/keita1994/followers","following_url":"https://api.github.com/users/keita1994/following{/other_user}","gists_url":"https://api.github.com/users/keita1994/gists{/gist_id}","starred_url":"https://api.github.com/users/keita1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keita1994/subscriptions","organizations_url":"https://api.github.com/users/keita1994/orgs","repos_url":"https://api.github.com/users/keita1994/repos","events_url":"https://api.github.com/users/keita1994/events{/privacy}","received_events_url":"https://api.github.com/users/keita1994/received_events","type":"User","site_admin":false},"repo":{"id":155700576,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU3MDA1NzY=","name":"chat-space","full_name":"keita1994/chat-space","private":false,"owner":{"login":"keita1994","id":44360152,"node_id":"MDQ6VXNlcjQ0MzYwMTUy","avatar_url":"https://avatars3.githubusercontent.com/u/44360152?v=4","gravatar_id":"","url":"https://api.github.com/users/keita1994","html_url":"https://github.com/keita1994","followers_url":"https://api.github.com/users/keita1994/followers","following_url":"https://api.github.com/users/keita1994/following{/other_user}","gists_url":"https://api.github.com/users/keita1994/gists{/gist_id}","starred_url":"https://api.github.com/users/keita1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keita1994/subscriptions","organizations_url":"https://api.github.com/users/keita1994/orgs","repos_url":"https://api.github.com/users/keita1994/repos","events_url":"https://api.github.com/users/keita1994/events{/privacy}","received_events_url":"https://api.github.com/users/keita1994/received_events","type":"User","site_admin":false},"html_url":"https://github.com/keita1994/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/keita1994/chat-space","forks_url":"https://api.github.com/repos/keita1994/chat-space/forks","keys_url":"https://api.github.com/repos/keita1994/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keita1994/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keita1994/chat-space/teams","hooks_url":"https://api.github.com/repos/keita1994/chat-space/hooks","issue_events_url":"https://api.github.com/repos/keita1994/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/keita1994/chat-space/events","assignees_url":"https://api.github.com/repos/keita1994/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/keita1994/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/keita1994/chat-space/tags","blobs_url":"https://api.github.com/repos/keita1994/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keita1994/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keita1994/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/keita1994/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keita1994/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/keita1994/chat-space/languages","stargazers_url":"https://api.github.com/repos/keita1994/chat-space/stargazers","contributors_url":"https://api.github.com/repos/keita1994/chat-space/contributors","subscribers_url":"https://api.github.com/repos/keita1994/chat-space/subscribers","subscription_url":"https://api.github.com/repos/keita1994/chat-space/subscription","commits_url":"https://api.github.com/repos/keita1994/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/keita1994/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/keita1994/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/keita1994/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/keita1994/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/keita1994/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keita1994/chat-space/merges","archive_url":"https://api.github.com/repos/keita1994/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keita1994/chat-space/downloads","issues_url":"https://api.github.com/repos/keita1994/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/keita1994/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/keita1994/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/keita1994/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keita1994/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/keita1994/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/keita1994/chat-space/deployments","created_at":"2018-11-01T10:47:01Z","updated_at":"2018-11-01T10:47:13Z","pushed_at":"2018-11-03T06:05:36Z","git_url":"git://github.com/keita1994/chat-space.git","ssh_url":"git@github.com:keita1994/chat-space.git","clone_url":"https://github.com/keita1994/chat-space.git","svn_url":"https://github.com/keita1994/chat-space","homepage":null,"size":20,"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,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"keita1994:master","ref":"master","sha":"eeea666d9fc862f4d733c83d07def162699d61fe","user":{"login":"keita1994","id":44360152,"node_id":"MDQ6VXNlcjQ0MzYwMTUy","avatar_url":"https://avatars3.githubusercontent.com/u/44360152?v=4","gravatar_id":"","url":"https://api.github.com/users/keita1994","html_url":"https://github.com/keita1994","followers_url":"https://api.github.com/users/keita1994/followers","following_url":"https://api.github.com/users/keita1994/following{/other_user}","gists_url":"https://api.github.com/users/keita1994/gists{/gist_id}","starred_url":"https://api.github.com/users/keita1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keita1994/subscriptions","organizations_url":"https://api.github.com/users/keita1994/orgs","repos_url":"https://api.github.com/users/keita1994/repos","events_url":"https://api.github.com/users/keita1994/events{/privacy}","received_events_url":"https://api.github.com/users/keita1994/received_events","type":"User","site_admin":false},"repo":{"id":155700576,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU3MDA1NzY=","name":"chat-space","full_name":"keita1994/chat-space","private":false,"owner":{"login":"keita1994","id":44360152,"node_id":"MDQ6VXNlcjQ0MzYwMTUy","avatar_url":"https://avatars3.githubusercontent.com/u/44360152?v=4","gravatar_id":"","url":"https://api.github.com/users/keita1994","html_url":"https://github.com/keita1994","followers_url":"https://api.github.com/users/keita1994/followers","following_url":"https://api.github.com/users/keita1994/following{/other_user}","gists_url":"https://api.github.com/users/keita1994/gists{/gist_id}","starred_url":"https://api.github.com/users/keita1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keita1994/subscriptions","organizations_url":"https://api.github.com/users/keita1994/orgs","repos_url":"https://api.github.com/users/keita1994/repos","events_url":"https://api.github.com/users/keita1994/events{/privacy}","received_events_url":"https://api.github.com/users/keita1994/received_events","type":"User","site_admin":false},"html_url":"https://github.com/keita1994/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/keita1994/chat-space","forks_url":"https://api.github.com/repos/keita1994/chat-space/forks","keys_url":"https://api.github.com/repos/keita1994/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keita1994/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keita1994/chat-space/teams","hooks_url":"https://api.github.com/repos/keita1994/chat-space/hooks","issue_events_url":"https://api.github.com/repos/keita1994/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/keita1994/chat-space/events","assignees_url":"https://api.github.com/repos/keita1994/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/keita1994/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/keita1994/chat-space/tags","blobs_url":"https://api.github.com/repos/keita1994/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keita1994/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keita1994/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/keita1994/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keita1994/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/keita1994/chat-space/languages","stargazers_url":"https://api.github.com/repos/keita1994/chat-space/stargazers","contributors_url":"https://api.github.com/repos/keita1994/chat-space/contributors","subscribers_url":"https://api.github.com/repos/keita1994/chat-space/subscribers","subscription_url":"https://api.github.com/repos/keita1994/chat-space/subscription","commits_url":"https://api.github.com/repos/keita1994/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/keita1994/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/keita1994/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/keita1994/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/keita1994/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/keita1994/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keita1994/chat-space/merges","archive_url":"https://api.github.com/repos/keita1994/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keita1994/chat-space/downloads","issues_url":"https://api.github.com/repos/keita1994/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/keita1994/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/keita1994/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/keita1994/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keita1994/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/keita1994/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/keita1994/chat-space/deployments","created_at":"2018-11-01T10:47:01Z","updated_at":"2018-11-01T10:47:13Z","pushed_at":"2018-11-03T06:05:36Z","git_url":"git://github.com/keita1994/chat-space.git","ssh_url":"git@github.com:keita1994/chat-space.git","clone_url":"https://github.com/keita1994/chat-space.git","svn_url":"https://github.com/keita1994/chat-space","homepage":null,"size":20,"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,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keita1994/chat-space/pulls/1"},"html":{"href":"https://github.com/keita1994/chat-space/pull/1"},"issue":{"href":"https://api.github.com/repos/keita1994/chat-space/issues/1"},"comments":{"href":"https://api.github.com/repos/keita1994/chat-space/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/keita1994/chat-space/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/keita1994/chat-space/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keita1994/chat-space/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/keita1994/chat-space/statuses/071c6c56dce1c17b8430561cbeaa6b88f5425f3d"}},"author_association":"OWNER"}}
{"actor":{"display_login":"kohei-isoda"}}