{"action":"created","comment":{"url":"https://api.github.com/repos/norahito/dive23/pulls/comments/82502469","pull_request_review_id":3408332,"id":82502469,"diff_hunk":"@@ -95,18 +77,175 @@\n \n Ans3 = \n \"\n+特に指定が無ければ\n ｘｘｘｘｘｘｘｘｘ。\n ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘ。\n \"\n \n-arr = [Ans1, Ans2, Ans3]\n+Ans4 = \n+\"\n+既に解決済みかもしれませんが\n+ｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+\"\n \n-arr.each do |n|\n-  Answer.create!(\n-  question_id: question_id,\n-  user_id: user_id,\n-  content: n,\n-  )\n-end\n\\ No newline at end of file\n+Ans5 = \n+\"\n+補足となりますが\n+ｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘ。\n+\"\n+\n+Ans6 = \n+\"\n+横から失礼します\n+ｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘ。\n+ｘｘｘｘｘｘｘｘｘ。\n+\"\n+# answers_array\n+answers = [Ans1, Ans2, Ans3, Ans4, Ans5, Ans6]\n+\n+# seach users ordered by id\n+users = User.all.order(:id)\n+\n+users.each { |user| \n+  question_user_id = user.id\n+  tag_id_array = [*1..25].sample(3).sort\n+  tag_id_array.each do |tag_id|\n+    tag = Tag.find(tag_id)\n+    # Quesiton\n+    title = \"これは\" + tag.name + \"に関する質問です。\"\n+    content = \n+    \"お世話になっております。\" + tag.name + \"についての質問です。\n+    ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+    ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+    ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+    ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ？\n+    ｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘｘ。\n+    以上、よろしくお願い致します。\"\n+    # create question\n+    Question.create!(\n+      user_id: question_user_id,\n+      title: title,\n+      content: content,\n+    )\n+    \n+    question_id = Question.all.order(:id).last.id\n+    \n+    # tag_relations \n+    TagRelation.create!(\n+      question_id: question_id,\n+      tag_id: tag_id,\n+    )\n+    # set second tag (one in third that this will be created)\n+    if rand(3) + 1 == 1\n+      second_tag_id = [*1..25].reject{ |tag| tag == tag_id }.sample\n+      TagRelation.create!(\n+        question_id: question_id,\n+        tag_id: second_tag_id,\n+      )\n+      # set third tag (this will rarely happen)\n+      if rand(2) + 1 == 1\n+        third_tag_id = [*1..25].reject{ |tag| (tag == tag_id) || (tag == second_tag_id) }.sample\n+        TagRelation.create!(\n+          question_id: question_id,\n+          tag_id: third_tag_id,\n+        )\n+      end\n+    end\n+    \n+    # favorites and question_votes\n+    if rand(3) + 1 == 1\n+      the_other_users_id = users.pluck(:id).reject{ |id| id == question_user_id }.sample(4)\n+      the_other_users_id.each do |other_user_id|\n+        #  one in third the_other_users will bookmark this question\n+        if rand(3) + 1 == 1\n+          # favorites\n+          Favorite.create!(\n+            user_id: other_user_id,\n+            question_id: question_id,\n+          )\n+          # votes for question\n+          # 1/4 is negative\n+          if rand(4) + 1 == 1\n+            Vote.create!(","path":"db/seeds.rb","position":193,"original_position":193,"commit_id":"161d64716a826eea1168992dfa3baee72cb3c9de","original_commit_id":"161d64716a826eea1168992dfa3baee72cb3c9de","user":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"body":"投票する場合は1/4の確率でネガティブな投票をします。3/4はポジティブな投票です。","created_at":"2016-10-08T13:22:17Z","updated_at":"2016-10-08T13:22:24Z","html_url":"https://github.com/norahito/dive23/pull/161#discussion_r82502469","pull_request_url":"https://api.github.com/repos/norahito/dive23/pulls/161","_links":{"self":{"href":"https://api.github.com/repos/norahito/dive23/pulls/comments/82502469"},"html":{"href":"https://github.com/norahito/dive23/pull/161#discussion_r82502469"},"pull_request":{"href":"https://api.github.com/repos/norahito/dive23/pulls/161"}}},"pull_request":{"url":"https://api.github.com/repos/norahito/dive23/pulls/161","id":88543670,"html_url":"https://github.com/norahito/dive23/pull/161","diff_url":"https://github.com/norahito/dive23/pull/161.diff","patch_url":"https://github.com/norahito/dive23/pull/161.patch","issue_url":"https://api.github.com/repos/norahito/dive23/issues/161","number":161,"state":"open","locked":false,"title":"Seedデータを増量する","user":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"body":"Issues#158\r\n\r\n現状のデータ数では機能の確認がし難いので各種テストデータを増量する。\r\n追加したのは下記の通り\r\n+ votes(関連するUserのスコアやquestionとanswerのcount等も計算してセット)\r\n+ favorites\r\n+ userのavator","created_at":"2016-10-08T11:51:41Z","updated_at":"2016-10-08T13:22:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d7a5e6419ccf77721f6124ac88420af8701272d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/norahito/dive23/pulls/161/commits","review_comments_url":"https://api.github.com/repos/norahito/dive23/pulls/161/comments","review_comment_url":"https://api.github.com/repos/norahito/dive23/pulls/comments{/number}","comments_url":"https://api.github.com/repos/norahito/dive23/issues/161/comments","statuses_url":"https://api.github.com/repos/norahito/dive23/statuses/161d64716a826eea1168992dfa3baee72cb3c9de","head":{"label":"norahito:issues#158","ref":"issues#158","sha":"161d64716a826eea1168992dfa3baee72cb3c9de","user":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"repo":{"id":65704670,"name":"dive23","full_name":"norahito/dive23","owner":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/norahito/dive23","description":"repository for dive23","fork":false,"url":"https://api.github.com/repos/norahito/dive23","forks_url":"https://api.github.com/repos/norahito/dive23/forks","keys_url":"https://api.github.com/repos/norahito/dive23/keys{/key_id}","collaborators_url":"https://api.github.com/repos/norahito/dive23/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/norahito/dive23/teams","hooks_url":"https://api.github.com/repos/norahito/dive23/hooks","issue_events_url":"https://api.github.com/repos/norahito/dive23/issues/events{/number}","events_url":"https://api.github.com/repos/norahito/dive23/events","assignees_url":"https://api.github.com/repos/norahito/dive23/assignees{/user}","branches_url":"https://api.github.com/repos/norahito/dive23/branches{/branch}","tags_url":"https://api.github.com/repos/norahito/dive23/tags","blobs_url":"https://api.github.com/repos/norahito/dive23/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/norahito/dive23/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/norahito/dive23/git/refs{/sha}","trees_url":"https://api.github.com/repos/norahito/dive23/git/trees{/sha}","statuses_url":"https://api.github.com/repos/norahito/dive23/statuses/{sha}","languages_url":"https://api.github.com/repos/norahito/dive23/languages","stargazers_url":"https://api.github.com/repos/norahito/dive23/stargazers","contributors_url":"https://api.github.com/repos/norahito/dive23/contributors","subscribers_url":"https://api.github.com/repos/norahito/dive23/subscribers","subscription_url":"https://api.github.com/repos/norahito/dive23/subscription","commits_url":"https://api.github.com/repos/norahito/dive23/commits{/sha}","git_commits_url":"https://api.github.com/repos/norahito/dive23/git/commits{/sha}","comments_url":"https://api.github.com/repos/norahito/dive23/comments{/number}","issue_comment_url":"https://api.github.com/repos/norahito/dive23/issues/comments{/number}","contents_url":"https://api.github.com/repos/norahito/dive23/contents/{+path}","compare_url":"https://api.github.com/repos/norahito/dive23/compare/{base}...{head}","merges_url":"https://api.github.com/repos/norahito/dive23/merges","archive_url":"https://api.github.com/repos/norahito/dive23/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/norahito/dive23/downloads","issues_url":"https://api.github.com/repos/norahito/dive23/issues{/number}","pulls_url":"https://api.github.com/repos/norahito/dive23/pulls{/number}","milestones_url":"https://api.github.com/repos/norahito/dive23/milestones{/number}","notifications_url":"https://api.github.com/repos/norahito/dive23/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/norahito/dive23/labels{/name}","releases_url":"https://api.github.com/repos/norahito/dive23/releases{/id}","deployments_url":"https://api.github.com/repos/norahito/dive23/deployments","created_at":"2016-08-15T04:32:55Z","updated_at":"2016-08-15T12:15:08Z","pushed_at":"2016-10-08T11:51:42Z","git_url":"git://github.com/norahito/dive23.git","ssh_url":"git@github.com:norahito/dive23.git","clone_url":"https://github.com/norahito/dive23.git","svn_url":"https://github.com/norahito/dive23","homepage":null,"size":2043,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":1,"default_branch":"master"}},"base":{"label":"norahito:master","ref":"master","sha":"5124007ff0c2c26e52c6ae119a27018105d0380d","user":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"repo":{"id":65704670,"name":"dive23","full_name":"norahito/dive23","owner":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/norahito/dive23","description":"repository for dive23","fork":false,"url":"https://api.github.com/repos/norahito/dive23","forks_url":"https://api.github.com/repos/norahito/dive23/forks","keys_url":"https://api.github.com/repos/norahito/dive23/keys{/key_id}","collaborators_url":"https://api.github.com/repos/norahito/dive23/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/norahito/dive23/teams","hooks_url":"https://api.github.com/repos/norahito/dive23/hooks","issue_events_url":"https://api.github.com/repos/norahito/dive23/issues/events{/number}","events_url":"https://api.github.com/repos/norahito/dive23/events","assignees_url":"https://api.github.com/repos/norahito/dive23/assignees{/user}","branches_url":"https://api.github.com/repos/norahito/dive23/branches{/branch}","tags_url":"https://api.github.com/repos/norahito/dive23/tags","blobs_url":"https://api.github.com/repos/norahito/dive23/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/norahito/dive23/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/norahito/dive23/git/refs{/sha}","trees_url":"https://api.github.com/repos/norahito/dive23/git/trees{/sha}","statuses_url":"https://api.github.com/repos/norahito/dive23/statuses/{sha}","languages_url":"https://api.github.com/repos/norahito/dive23/languages","stargazers_url":"https://api.github.com/repos/norahito/dive23/stargazers","contributors_url":"https://api.github.com/repos/norahito/dive23/contributors","subscribers_url":"https://api.github.com/repos/norahito/dive23/subscribers","subscription_url":"https://api.github.com/repos/norahito/dive23/subscription","commits_url":"https://api.github.com/repos/norahito/dive23/commits{/sha}","git_commits_url":"https://api.github.com/repos/norahito/dive23/git/commits{/sha}","comments_url":"https://api.github.com/repos/norahito/dive23/comments{/number}","issue_comment_url":"https://api.github.com/repos/norahito/dive23/issues/comments{/number}","contents_url":"https://api.github.com/repos/norahito/dive23/contents/{+path}","compare_url":"https://api.github.com/repos/norahito/dive23/compare/{base}...{head}","merges_url":"https://api.github.com/repos/norahito/dive23/merges","archive_url":"https://api.github.com/repos/norahito/dive23/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/norahito/dive23/downloads","issues_url":"https://api.github.com/repos/norahito/dive23/issues{/number}","pulls_url":"https://api.github.com/repos/norahito/dive23/pulls{/number}","milestones_url":"https://api.github.com/repos/norahito/dive23/milestones{/number}","notifications_url":"https://api.github.com/repos/norahito/dive23/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/norahito/dive23/labels{/name}","releases_url":"https://api.github.com/repos/norahito/dive23/releases{/id}","deployments_url":"https://api.github.com/repos/norahito/dive23/deployments","created_at":"2016-08-15T04:32:55Z","updated_at":"2016-08-15T12:15:08Z","pushed_at":"2016-10-08T11:51:42Z","git_url":"git://github.com/norahito/dive23.git","ssh_url":"git@github.com:norahito/dive23.git","clone_url":"https://github.com/norahito/dive23.git","svn_url":"https://github.com/norahito/dive23","homepage":null,"size":2043,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/norahito/dive23/pulls/161"},"html":{"href":"https://github.com/norahito/dive23/pull/161"},"issue":{"href":"https://api.github.com/repos/norahito/dive23/issues/161"},"comments":{"href":"https://api.github.com/repos/norahito/dive23/issues/161/comments"},"review_comments":{"href":"https://api.github.com/repos/norahito/dive23/pulls/161/comments"},"review_comment":{"href":"https://api.github.com/repos/norahito/dive23/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/norahito/dive23/pulls/161/commits"},"statuses":{"href":"https://api.github.com/repos/norahito/dive23/statuses/161d64716a826eea1168992dfa3baee72cb3c9de"}}}}
{"actor":{"display_login":"norahito"}}