{"action":"created","comment":{"url":"https://api.github.com/repos/tricycle/predictionbook/pulls/comments/62954128","id":62954128,"diff_hunk":"@@ -0,0 +1,70 @@\n+class CredenceGameResponse < ActiveRecord::Base\n+  belongs_to :credence_game\n+  belongs_to :credence_question\n+  belongs_to :first_answer, class_name: 'CredenceAnswer'\n+  belongs_to :second_answer, class_name: 'CredenceAnswer'\n+\n+  def self.pick_random\n+    enabled_gens = CredenceQuestion.where(enabled: true)\n+    num_enabled = enabled_gens.count\n+\n+    gen = enabled_gens.first(offset: rand(num_enabled))\n+    while !gen.enabled || gen.weight < rand\n+      gen = enabled_gens.first(offset: rand(num_enabled))\n+    end\n+\n+    gen.create_random_question","path":"app/models/credence_game_response.rb","position":null,"original_position":16,"commit_id":"bf29572866b4198c9fda3931ac626b772d59a35b","original_commit_id":"01b221fb1d147136034eb2f27958b2cfc1f2f463","user":{"login":"theminted","id":684561,"avatar_url":"https://avatars.githubusercontent.com/u/684561?v=3","gravatar_id":"","url":"https://api.github.com/users/theminted","html_url":"https://github.com/theminted","followers_url":"https://api.github.com/users/theminted/followers","following_url":"https://api.github.com/users/theminted/following{/other_user}","gists_url":"https://api.github.com/users/theminted/gists{/gist_id}","starred_url":"https://api.github.com/users/theminted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theminted/subscriptions","organizations_url":"https://api.github.com/users/theminted/orgs","repos_url":"https://api.github.com/users/theminted/repos","events_url":"https://api.github.com/users/theminted/events{/privacy}","received_events_url":"https://api.github.com/users/theminted/received_events","type":"User","site_admin":false},"body":"This still says `gen`. I do not know what a `gen` is.","created_at":"2016-05-12T01:33:37Z","updated_at":"2016-05-12T01:33:37Z","html_url":"https://github.com/tricycle/predictionbook/pull/74#discussion_r62954128","pull_request_url":"https://api.github.com/repos/tricycle/predictionbook/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/tricycle/predictionbook/pulls/comments/62954128"},"html":{"href":"https://github.com/tricycle/predictionbook/pull/74#discussion_r62954128"},"pull_request":{"href":"https://api.github.com/repos/tricycle/predictionbook/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/tricycle/predictionbook/pulls/74","id":44987854,"html_url":"https://github.com/tricycle/predictionbook/pull/74","diff_url":"https://github.com/tricycle/predictionbook/pull/74.diff","patch_url":"https://github.com/tricycle/predictionbook/pull/74.patch","issue_url":"https://api.github.com/repos/tricycle/predictionbook/issues/74","number":74,"state":"open","locked":false,"title":"Credence game","user":{"login":"ChickenProp","id":57271,"avatar_url":"https://avatars.githubusercontent.com/u/57271?v=3","gravatar_id":"","url":"https://api.github.com/users/ChickenProp","html_url":"https://github.com/ChickenProp","followers_url":"https://api.github.com/users/ChickenProp/followers","following_url":"https://api.github.com/users/ChickenProp/following{/other_user}","gists_url":"https://api.github.com/users/ChickenProp/gists{/gist_id}","starred_url":"https://api.github.com/users/ChickenProp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChickenProp/subscriptions","organizations_url":"https://api.github.com/users/ChickenProp/orgs","repos_url":"https://api.github.com/users/ChickenProp/repos","events_url":"https://api.github.com/users/ChickenProp/events{/privacy}","received_events_url":"https://api.github.com/users/ChickenProp/received_events","type":"User","site_admin":false},"body":"Early implementation of the credence game. I don't expect it to be ready to go live, but I'd like feedback on what to do to make it ready.","created_at":"2015-09-14T22:14:48Z","updated_at":"2016-05-12T01:33:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a1cae061beccbaf3edcbbd0e130b7de077c084d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tricycle/predictionbook/pulls/74/commits","review_comments_url":"https://api.github.com/repos/tricycle/predictionbook/pulls/74/comments","review_comment_url":"https://api.github.com/repos/tricycle/predictionbook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tricycle/predictionbook/issues/74/comments","statuses_url":"https://api.github.com/repos/tricycle/predictionbook/statuses/bf29572866b4198c9fda3931ac626b772d59a35b","head":{"label":"ChickenProp:credence-game","ref":"credence-game","sha":"bf29572866b4198c9fda3931ac626b772d59a35b","user":{"login":"ChickenProp","id":57271,"avatar_url":"https://avatars.githubusercontent.com/u/57271?v=3","gravatar_id":"","url":"https://api.github.com/users/ChickenProp","html_url":"https://github.com/ChickenProp","followers_url":"https://api.github.com/users/ChickenProp/followers","following_url":"https://api.github.com/users/ChickenProp/following{/other_user}","gists_url":"https://api.github.com/users/ChickenProp/gists{/gist_id}","starred_url":"https://api.github.com/users/ChickenProp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChickenProp/subscriptions","organizations_url":"https://api.github.com/users/ChickenProp/orgs","repos_url":"https://api.github.com/users/ChickenProp/repos","events_url":"https://api.github.com/users/ChickenProp/events{/privacy}","received_events_url":"https://api.github.com/users/ChickenProp/received_events","type":"User","site_admin":false},"repo":{"id":16030380,"name":"predictionbook","full_name":"ChickenProp/predictionbook","owner":{"login":"ChickenProp","id":57271,"avatar_url":"https://avatars.githubusercontent.com/u/57271?v=3","gravatar_id":"","url":"https://api.github.com/users/ChickenProp","html_url":"https://github.com/ChickenProp","followers_url":"https://api.github.com/users/ChickenProp/followers","following_url":"https://api.github.com/users/ChickenProp/following{/other_user}","gists_url":"https://api.github.com/users/ChickenProp/gists{/gist_id}","starred_url":"https://api.github.com/users/ChickenProp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChickenProp/subscriptions","organizations_url":"https://api.github.com/users/ChickenProp/orgs","repos_url":"https://api.github.com/users/ChickenProp/repos","events_url":"https://api.github.com/users/ChickenProp/events{/privacy}","received_events_url":"https://api.github.com/users/ChickenProp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ChickenProp/predictionbook","description":"","fork":true,"url":"https://api.github.com/repos/ChickenProp/predictionbook","forks_url":"https://api.github.com/repos/ChickenProp/predictionbook/forks","keys_url":"https://api.github.com/repos/ChickenProp/predictionbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChickenProp/predictionbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChickenProp/predictionbook/teams","hooks_url":"https://api.github.com/repos/ChickenProp/predictionbook/hooks","issue_events_url":"https://api.github.com/repos/ChickenProp/predictionbook/issues/events{/number}","events_url":"https://api.github.com/repos/ChickenProp/predictionbook/events","assignees_url":"https://api.github.com/repos/ChickenProp/predictionbook/assignees{/user}","branches_url":"https://api.github.com/repos/ChickenProp/predictionbook/branches{/branch}","tags_url":"https://api.github.com/repos/ChickenProp/predictionbook/tags","blobs_url":"https://api.github.com/repos/ChickenProp/predictionbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChickenProp/predictionbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChickenProp/predictionbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChickenProp/predictionbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChickenProp/predictionbook/statuses/{sha}","languages_url":"https://api.github.com/repos/ChickenProp/predictionbook/languages","stargazers_url":"https://api.github.com/repos/ChickenProp/predictionbook/stargazers","contributors_url":"https://api.github.com/repos/ChickenProp/predictionbook/contributors","subscribers_url":"https://api.github.com/repos/ChickenProp/predictionbook/subscribers","subscription_url":"https://api.github.com/repos/ChickenProp/predictionbook/subscription","commits_url":"https://api.github.com/repos/ChickenProp/predictionbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChickenProp/predictionbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChickenProp/predictionbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChickenProp/predictionbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/ChickenProp/predictionbook/contents/{+path}","compare_url":"https://api.github.com/repos/ChickenProp/predictionbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChickenProp/predictionbook/merges","archive_url":"https://api.github.com/repos/ChickenProp/predictionbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChickenProp/predictionbook/downloads","issues_url":"https://api.github.com/repos/ChickenProp/predictionbook/issues{/number}","pulls_url":"https://api.github.com/repos/ChickenProp/predictionbook/pulls{/number}","milestones_url":"https://api.github.com/repos/ChickenProp/predictionbook/milestones{/number}","notifications_url":"https://api.github.com/repos/ChickenProp/predictionbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChickenProp/predictionbook/labels{/name}","releases_url":"https://api.github.com/repos/ChickenProp/predictionbook/releases{/id}","deployments_url":"https://api.github.com/repos/ChickenProp/predictionbook/deployments","created_at":"2014-01-18T17:35:10Z","updated_at":"2014-08-27T21:46:55Z","pushed_at":"2016-03-29T20:47:56Z","git_url":"git://github.com/ChickenProp/predictionbook.git","ssh_url":"git@github.com:ChickenProp/predictionbook.git","clone_url":"https://github.com/ChickenProp/predictionbook.git","svn_url":"https://github.com/ChickenProp/predictionbook","homepage":null,"size":992,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"credence-game"}},"base":{"label":"tricycle:master","ref":"master","sha":"50675e9a123854865de2e3d7eb57ed694f19211d","user":{"login":"tricycle","id":11724,"avatar_url":"https://avatars.githubusercontent.com/u/11724?v=3","gravatar_id":"","url":"https://api.github.com/users/tricycle","html_url":"https://github.com/tricycle","followers_url":"https://api.github.com/users/tricycle/followers","following_url":"https://api.github.com/users/tricycle/following{/other_user}","gists_url":"https://api.github.com/users/tricycle/gists{/gist_id}","starred_url":"https://api.github.com/users/tricycle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tricycle/subscriptions","organizations_url":"https://api.github.com/users/tricycle/orgs","repos_url":"https://api.github.com/users/tricycle/repos","events_url":"https://api.github.com/users/tricycle/events{/privacy}","received_events_url":"https://api.github.com/users/tricycle/received_events","type":"Organization","site_admin":false},"repo":{"id":8616031,"name":"predictionbook","full_name":"tricycle/predictionbook","owner":{"login":"tricycle","id":11724,"avatar_url":"https://avatars.githubusercontent.com/u/11724?v=3","gravatar_id":"","url":"https://api.github.com/users/tricycle","html_url":"https://github.com/tricycle","followers_url":"https://api.github.com/users/tricycle/followers","following_url":"https://api.github.com/users/tricycle/following{/other_user}","gists_url":"https://api.github.com/users/tricycle/gists{/gist_id}","starred_url":"https://api.github.com/users/tricycle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tricycle/subscriptions","organizations_url":"https://api.github.com/users/tricycle/orgs","repos_url":"https://api.github.com/users/tricycle/repos","events_url":"https://api.github.com/users/tricycle/events{/privacy}","received_events_url":"https://api.github.com/users/tricycle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tricycle/predictionbook","description":"Find out just how sure you should be, and get better at being only as sure as the facts justify.","fork":false,"url":"https://api.github.com/repos/tricycle/predictionbook","forks_url":"https://api.github.com/repos/tricycle/predictionbook/forks","keys_url":"https://api.github.com/repos/tricycle/predictionbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tricycle/predictionbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tricycle/predictionbook/teams","hooks_url":"https://api.github.com/repos/tricycle/predictionbook/hooks","issue_events_url":"https://api.github.com/repos/tricycle/predictionbook/issues/events{/number}","events_url":"https://api.github.com/repos/tricycle/predictionbook/events","assignees_url":"https://api.github.com/repos/tricycle/predictionbook/assignees{/user}","branches_url":"https://api.github.com/repos/tricycle/predictionbook/branches{/branch}","tags_url":"https://api.github.com/repos/tricycle/predictionbook/tags","blobs_url":"https://api.github.com/repos/tricycle/predictionbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tricycle/predictionbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tricycle/predictionbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/tricycle/predictionbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tricycle/predictionbook/statuses/{sha}","languages_url":"https://api.github.com/repos/tricycle/predictionbook/languages","stargazers_url":"https://api.github.com/repos/tricycle/predictionbook/stargazers","contributors_url":"https://api.github.com/repos/tricycle/predictionbook/contributors","subscribers_url":"https://api.github.com/repos/tricycle/predictionbook/subscribers","subscription_url":"https://api.github.com/repos/tricycle/predictionbook/subscription","commits_url":"https://api.github.com/repos/tricycle/predictionbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/tricycle/predictionbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/tricycle/predictionbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/tricycle/predictionbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/tricycle/predictionbook/contents/{+path}","compare_url":"https://api.github.com/repos/tricycle/predictionbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tricycle/predictionbook/merges","archive_url":"https://api.github.com/repos/tricycle/predictionbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tricycle/predictionbook/downloads","issues_url":"https://api.github.com/repos/tricycle/predictionbook/issues{/number}","pulls_url":"https://api.github.com/repos/tricycle/predictionbook/pulls{/number}","milestones_url":"https://api.github.com/repos/tricycle/predictionbook/milestones{/number}","notifications_url":"https://api.github.com/repos/tricycle/predictionbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tricycle/predictionbook/labels{/name}","releases_url":"https://api.github.com/repos/tricycle/predictionbook/releases{/id}","deployments_url":"https://api.github.com/repos/tricycle/predictionbook/deployments","created_at":"2013-03-06T23:43:20Z","updated_at":"2016-04-09T11:01:12Z","pushed_at":"2016-05-11T04:11:58Z","git_url":"git://github.com/tricycle/predictionbook.git","ssh_url":"git@github.com:tricycle/predictionbook.git","clone_url":"https://github.com/tricycle/predictionbook.git","svn_url":"https://github.com/tricycle/predictionbook","homepage":"http://predictionbook.com/","size":1040,"stargazers_count":19,"watchers_count":19,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":55,"forks":11,"open_issues":55,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tricycle/predictionbook/pulls/74"},"html":{"href":"https://github.com/tricycle/predictionbook/pull/74"},"issue":{"href":"https://api.github.com/repos/tricycle/predictionbook/issues/74"},"comments":{"href":"https://api.github.com/repos/tricycle/predictionbook/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/tricycle/predictionbook/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/tricycle/predictionbook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tricycle/predictionbook/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/tricycle/predictionbook/statuses/bf29572866b4198c9fda3931ac626b772d59a35b"}}}}