{"action":"created","comment":{"url":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/comments/41699981","id":41699981,"diff_hunk":"@@ -0,0 +1,19 @@\n+class Query < ActiveRecord::Base\n+  after_create :set_recommendation\n+\n+  belongs_to :user\n+  belongs_to :question\n+  belongs_to :selected_choice, class_name: \"Choice\"\n+  belongs_to :recommended_choice, class_name: \"Choice\"\n+\n+  validates :question, presence: true\n+  validates :rating, numericality: { only_integer: true, allow_nil: true }\n+  validates :rating, inclusion: { in: 0..10, allow_nil: true }\n+\n+  private\n+\n+  def set_recommendation\n+    recommender = Recommender.new(self.question)\n+    self.update_attributes(recommended_choice: recommender.recommendation)","path":"app/models/query.rb","position":17,"original_position":17,"commit_id":"c6d5e94aadf7019adc3fa365fea93b45d244f495","original_commit_id":"c6d5e94aadf7019adc3fa365fea93b45d244f495","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Redundant `self` detected.","created_at":"2015-10-10T18:24:58Z","updated_at":"2015-10-10T18:24:58Z","html_url":"https://github.com/justinhuynh/decision-maker/pull/7#discussion_r41699981","pull_request_url":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/comments/41699981"},"html":{"href":"https://github.com/justinhuynh/decision-maker/pull/7#discussion_r41699981"},"pull_request":{"href":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/7","id":47350978,"html_url":"https://github.com/justinhuynh/decision-maker/pull/7","diff_url":"https://github.com/justinhuynh/decision-maker/pull/7.diff","patch_url":"https://github.com/justinhuynh/decision-maker/pull/7.patch","issue_url":"https://api.github.com/repos/justinhuynh/decision-maker/issues/7","number":7,"state":"open","locked":false,"title":"Sandbox new erd 2","user":{"login":"justinhuynh","id":8738301,"avatar_url":"https://avatars.githubusercontent.com/u/8738301?v=3","gravatar_id":"","url":"https://api.github.com/users/justinhuynh","html_url":"https://github.com/justinhuynh","followers_url":"https://api.github.com/users/justinhuynh/followers","following_url":"https://api.github.com/users/justinhuynh/following{/other_user}","gists_url":"https://api.github.com/users/justinhuynh/gists{/gist_id}","starred_url":"https://api.github.com/users/justinhuynh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinhuynh/subscriptions","organizations_url":"https://api.github.com/users/justinhuynh/orgs","repos_url":"https://api.github.com/users/justinhuynh/repos","events_url":"https://api.github.com/users/justinhuynh/events{/privacy}","received_events_url":"https://api.github.com/users/justinhuynh/received_events","type":"User","site_admin":false},"body":"added placeholder recommendation engine\r\nupdated query to include recommended choice\r\nupdated tests and factory girl","created_at":"2015-10-10T18:24:43Z","updated_at":"2015-10-10T18:24:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"835705b85fbfacef7c3a8f57edd592234df0ed8f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/7/commits","review_comments_url":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/7/comments","review_comment_url":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/justinhuynh/decision-maker/issues/7/comments","statuses_url":"https://api.github.com/repos/justinhuynh/decision-maker/statuses/c6d5e94aadf7019adc3fa365fea93b45d244f495","head":{"label":"justinhuynh:sandbox-new-erd-2","ref":"sandbox-new-erd-2","sha":"c6d5e94aadf7019adc3fa365fea93b45d244f495","user":{"login":"justinhuynh","id":8738301,"avatar_url":"https://avatars.githubusercontent.com/u/8738301?v=3","gravatar_id":"","url":"https://api.github.com/users/justinhuynh","html_url":"https://github.com/justinhuynh","followers_url":"https://api.github.com/users/justinhuynh/followers","following_url":"https://api.github.com/users/justinhuynh/following{/other_user}","gists_url":"https://api.github.com/users/justinhuynh/gists{/gist_id}","starred_url":"https://api.github.com/users/justinhuynh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinhuynh/subscriptions","organizations_url":"https://api.github.com/users/justinhuynh/orgs","repos_url":"https://api.github.com/users/justinhuynh/repos","events_url":"https://api.github.com/users/justinhuynh/events{/privacy}","received_events_url":"https://api.github.com/users/justinhuynh/received_events","type":"User","site_admin":false},"repo":{"id":43527545,"name":"decision-maker","full_name":"justinhuynh/decision-maker","owner":{"login":"justinhuynh","id":8738301,"avatar_url":"https://avatars.githubusercontent.com/u/8738301?v=3","gravatar_id":"","url":"https://api.github.com/users/justinhuynh","html_url":"https://github.com/justinhuynh","followers_url":"https://api.github.com/users/justinhuynh/followers","following_url":"https://api.github.com/users/justinhuynh/following{/other_user}","gists_url":"https://api.github.com/users/justinhuynh/gists{/gist_id}","starred_url":"https://api.github.com/users/justinhuynh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinhuynh/subscriptions","organizations_url":"https://api.github.com/users/justinhuynh/orgs","repos_url":"https://api.github.com/users/justinhuynh/repos","events_url":"https://api.github.com/users/justinhuynh/events{/privacy}","received_events_url":"https://api.github.com/users/justinhuynh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/justinhuynh/decision-maker","description":"","fork":false,"url":"https://api.github.com/repos/justinhuynh/decision-maker","forks_url":"https://api.github.com/repos/justinhuynh/decision-maker/forks","keys_url":"https://api.github.com/repos/justinhuynh/decision-maker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/justinhuynh/decision-maker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/justinhuynh/decision-maker/teams","hooks_url":"https://api.github.com/repos/justinhuynh/decision-maker/hooks","issue_events_url":"https://api.github.com/repos/justinhuynh/decision-maker/issues/events{/number}","events_url":"https://api.github.com/repos/justinhuynh/decision-maker/events","assignees_url":"https://api.github.com/repos/justinhuynh/decision-maker/assignees{/user}","branches_url":"https://api.github.com/repos/justinhuynh/decision-maker/branches{/branch}","tags_url":"https://api.github.com/repos/justinhuynh/decision-maker/tags","blobs_url":"https://api.github.com/repos/justinhuynh/decision-maker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/justinhuynh/decision-maker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/justinhuynh/decision-maker/git/refs{/sha}","trees_url":"https://api.github.com/repos/justinhuynh/decision-maker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/justinhuynh/decision-maker/statuses/{sha}","languages_url":"https://api.github.com/repos/justinhuynh/decision-maker/languages","stargazers_url":"https://api.github.com/repos/justinhuynh/decision-maker/stargazers","contributors_url":"https://api.github.com/repos/justinhuynh/decision-maker/contributors","subscribers_url":"https://api.github.com/repos/justinhuynh/decision-maker/subscribers","subscription_url":"https://api.github.com/repos/justinhuynh/decision-maker/subscription","commits_url":"https://api.github.com/repos/justinhuynh/decision-maker/commits{/sha}","git_commits_url":"https://api.github.com/repos/justinhuynh/decision-maker/git/commits{/sha}","comments_url":"https://api.github.com/repos/justinhuynh/decision-maker/comments{/number}","issue_comment_url":"https://api.github.com/repos/justinhuynh/decision-maker/issues/comments{/number}","contents_url":"https://api.github.com/repos/justinhuynh/decision-maker/contents/{+path}","compare_url":"https://api.github.com/repos/justinhuynh/decision-maker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/justinhuynh/decision-maker/merges","archive_url":"https://api.github.com/repos/justinhuynh/decision-maker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/justinhuynh/decision-maker/downloads","issues_url":"https://api.github.com/repos/justinhuynh/decision-maker/issues{/number}","pulls_url":"https://api.github.com/repos/justinhuynh/decision-maker/pulls{/number}","milestones_url":"https://api.github.com/repos/justinhuynh/decision-maker/milestones{/number}","notifications_url":"https://api.github.com/repos/justinhuynh/decision-maker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/justinhuynh/decision-maker/labels{/name}","releases_url":"https://api.github.com/repos/justinhuynh/decision-maker/releases{/id}","created_at":"2015-10-01T23:59:01Z","updated_at":"2015-10-07T01:23:22Z","pushed_at":"2015-10-10T18:24:43Z","git_url":"git://github.com/justinhuynh/decision-maker.git","ssh_url":"git@github.com:justinhuynh/decision-maker.git","clone_url":"https://github.com/justinhuynh/decision-maker.git","svn_url":"https://github.com/justinhuynh/decision-maker","homepage":null,"size":7204,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"justinhuynh:master","ref":"master","sha":"4d749161eafaaf6818ae671252b6b4e8dee73592","user":{"login":"justinhuynh","id":8738301,"avatar_url":"https://avatars.githubusercontent.com/u/8738301?v=3","gravatar_id":"","url":"https://api.github.com/users/justinhuynh","html_url":"https://github.com/justinhuynh","followers_url":"https://api.github.com/users/justinhuynh/followers","following_url":"https://api.github.com/users/justinhuynh/following{/other_user}","gists_url":"https://api.github.com/users/justinhuynh/gists{/gist_id}","starred_url":"https://api.github.com/users/justinhuynh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinhuynh/subscriptions","organizations_url":"https://api.github.com/users/justinhuynh/orgs","repos_url":"https://api.github.com/users/justinhuynh/repos","events_url":"https://api.github.com/users/justinhuynh/events{/privacy}","received_events_url":"https://api.github.com/users/justinhuynh/received_events","type":"User","site_admin":false},"repo":{"id":43527545,"name":"decision-maker","full_name":"justinhuynh/decision-maker","owner":{"login":"justinhuynh","id":8738301,"avatar_url":"https://avatars.githubusercontent.com/u/8738301?v=3","gravatar_id":"","url":"https://api.github.com/users/justinhuynh","html_url":"https://github.com/justinhuynh","followers_url":"https://api.github.com/users/justinhuynh/followers","following_url":"https://api.github.com/users/justinhuynh/following{/other_user}","gists_url":"https://api.github.com/users/justinhuynh/gists{/gist_id}","starred_url":"https://api.github.com/users/justinhuynh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinhuynh/subscriptions","organizations_url":"https://api.github.com/users/justinhuynh/orgs","repos_url":"https://api.github.com/users/justinhuynh/repos","events_url":"https://api.github.com/users/justinhuynh/events{/privacy}","received_events_url":"https://api.github.com/users/justinhuynh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/justinhuynh/decision-maker","description":"","fork":false,"url":"https://api.github.com/repos/justinhuynh/decision-maker","forks_url":"https://api.github.com/repos/justinhuynh/decision-maker/forks","keys_url":"https://api.github.com/repos/justinhuynh/decision-maker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/justinhuynh/decision-maker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/justinhuynh/decision-maker/teams","hooks_url":"https://api.github.com/repos/justinhuynh/decision-maker/hooks","issue_events_url":"https://api.github.com/repos/justinhuynh/decision-maker/issues/events{/number}","events_url":"https://api.github.com/repos/justinhuynh/decision-maker/events","assignees_url":"https://api.github.com/repos/justinhuynh/decision-maker/assignees{/user}","branches_url":"https://api.github.com/repos/justinhuynh/decision-maker/branches{/branch}","tags_url":"https://api.github.com/repos/justinhuynh/decision-maker/tags","blobs_url":"https://api.github.com/repos/justinhuynh/decision-maker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/justinhuynh/decision-maker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/justinhuynh/decision-maker/git/refs{/sha}","trees_url":"https://api.github.com/repos/justinhuynh/decision-maker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/justinhuynh/decision-maker/statuses/{sha}","languages_url":"https://api.github.com/repos/justinhuynh/decision-maker/languages","stargazers_url":"https://api.github.com/repos/justinhuynh/decision-maker/stargazers","contributors_url":"https://api.github.com/repos/justinhuynh/decision-maker/contributors","subscribers_url":"https://api.github.com/repos/justinhuynh/decision-maker/subscribers","subscription_url":"https://api.github.com/repos/justinhuynh/decision-maker/subscription","commits_url":"https://api.github.com/repos/justinhuynh/decision-maker/commits{/sha}","git_commits_url":"https://api.github.com/repos/justinhuynh/decision-maker/git/commits{/sha}","comments_url":"https://api.github.com/repos/justinhuynh/decision-maker/comments{/number}","issue_comment_url":"https://api.github.com/repos/justinhuynh/decision-maker/issues/comments{/number}","contents_url":"https://api.github.com/repos/justinhuynh/decision-maker/contents/{+path}","compare_url":"https://api.github.com/repos/justinhuynh/decision-maker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/justinhuynh/decision-maker/merges","archive_url":"https://api.github.com/repos/justinhuynh/decision-maker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/justinhuynh/decision-maker/downloads","issues_url":"https://api.github.com/repos/justinhuynh/decision-maker/issues{/number}","pulls_url":"https://api.github.com/repos/justinhuynh/decision-maker/pulls{/number}","milestones_url":"https://api.github.com/repos/justinhuynh/decision-maker/milestones{/number}","notifications_url":"https://api.github.com/repos/justinhuynh/decision-maker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/justinhuynh/decision-maker/labels{/name}","releases_url":"https://api.github.com/repos/justinhuynh/decision-maker/releases{/id}","created_at":"2015-10-01T23:59:01Z","updated_at":"2015-10-07T01:23:22Z","pushed_at":"2015-10-10T18:24:43Z","git_url":"git://github.com/justinhuynh/decision-maker.git","ssh_url":"git@github.com:justinhuynh/decision-maker.git","clone_url":"https://github.com/justinhuynh/decision-maker.git","svn_url":"https://github.com/justinhuynh/decision-maker","homepage":null,"size":7204,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/7"},"html":{"href":"https://github.com/justinhuynh/decision-maker/pull/7"},"issue":{"href":"https://api.github.com/repos/justinhuynh/decision-maker/issues/7"},"comments":{"href":"https://api.github.com/repos/justinhuynh/decision-maker/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/justinhuynh/decision-maker/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/justinhuynh/decision-maker/statuses/c6d5e94aadf7019adc3fa365fea93b45d244f495"}}}}