{"action":"created","comment":{"url":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/comments/59798310","id":59798310,"diff_hunk":"@@ -0,0 +1,18 @@\n+class Vote < ActiveRecord::Base\n+  belongs_to :user\n+  belongs_to :review\n+\n+  validates :user, presence: true\n+  validates :review, presence: true\n+  validates :score, numericality: true, inclusion: { in: -1..1, message: \"A vote must be -1, 0, or 1\" }\n+\n+  def change_vote(new_vote)\n+    self.score = if self.score == new_vote\n+                   0\n+                 else\n+                   new_vote\n+                 end\n+    self.save\n+    self.score","path":"app/models/vote.rb","position":16,"original_position":16,"commit_id":"72966898d94c692ff5a02616c8ee64a89daec690","original_commit_id":"805e7b840c501b2ef0da3208be8c1ffebfe5efde","user":{"login":"CommanderTso","id":11823614,"avatar_url":"https://avatars.githubusercontent.com/u/11823614?v=3","gravatar_id":"","url":"https://api.github.com/users/CommanderTso","html_url":"https://github.com/CommanderTso","followers_url":"https://api.github.com/users/CommanderTso/followers","following_url":"https://api.github.com/users/CommanderTso/following{/other_user}","gists_url":"https://api.github.com/users/CommanderTso/gists{/gist_id}","starred_url":"https://api.github.com/users/CommanderTso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommanderTso/subscriptions","organizations_url":"https://api.github.com/users/CommanderTso/orgs","repos_url":"https://api.github.com/users/CommanderTso/repos","events_url":"https://api.github.com/users/CommanderTso/events{/privacy}","received_events_url":"https://api.github.com/users/CommanderTso/received_events","type":"User","site_admin":false},"body":"Keeping these, since it breaks when I take them out.","created_at":"2016-04-14T21:51:42Z","updated_at":"2016-04-14T21:51:42Z","html_url":"https://github.com/CommanderTso/ikea_reviews/pull/19#discussion_r59798310","pull_request_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/comments/59798310"},"html":{"href":"https://github.com/CommanderTso/ikea_reviews/pull/19#discussion_r59798310"},"pull_request":{"href":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/19","id":66539816,"html_url":"https://github.com/CommanderTso/ikea_reviews/pull/19","diff_url":"https://github.com/CommanderTso/ikea_reviews/pull/19.diff","patch_url":"https://github.com/CommanderTso/ikea_reviews/pull/19.patch","issue_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/issues/19","number":19,"state":"open","locked":false,"title":"Voting","user":{"login":"CommanderTso","id":11823614,"avatar_url":"https://avatars.githubusercontent.com/u/11823614?v=3","gravatar_id":"","url":"https://api.github.com/users/CommanderTso","html_url":"https://github.com/CommanderTso","followers_url":"https://api.github.com/users/CommanderTso/followers","following_url":"https://api.github.com/users/CommanderTso/following{/other_user}","gists_url":"https://api.github.com/users/CommanderTso/gists{/gist_id}","starred_url":"https://api.github.com/users/CommanderTso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommanderTso/subscriptions","organizations_url":"https://api.github.com/users/CommanderTso/orgs","repos_url":"https://api.github.com/users/CommanderTso/repos","events_url":"https://api.github.com/users/CommanderTso/events{/privacy}","received_events_url":"https://api.github.com/users/CommanderTso/received_events","type":"User","site_admin":false},"body":"- Implements voting both for http and ajax\r\n- Lots of tests!  \r\n- Switches test framework to use PhantomJS / Poltergeist, and moves the db cleaning strategy to truncation\r\n- Updates/additions to seed.rb and various factories\r\n- Cleanup of multiple small bugs / issues","created_at":"2016-04-14T19:26:03Z","updated_at":"2016-04-14T21:51:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c1e562dfbb0667650fef14dd08cf9dd559b5071","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/19/commits","review_comments_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/19/comments","review_comment_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/issues/19/comments","statuses_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/statuses/72966898d94c692ff5a02616c8ee64a89daec690","head":{"label":"CommanderTso:voting","ref":"voting","sha":"72966898d94c692ff5a02616c8ee64a89daec690","user":{"login":"CommanderTso","id":11823614,"avatar_url":"https://avatars.githubusercontent.com/u/11823614?v=3","gravatar_id":"","url":"https://api.github.com/users/CommanderTso","html_url":"https://github.com/CommanderTso","followers_url":"https://api.github.com/users/CommanderTso/followers","following_url":"https://api.github.com/users/CommanderTso/following{/other_user}","gists_url":"https://api.github.com/users/CommanderTso/gists{/gist_id}","starred_url":"https://api.github.com/users/CommanderTso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommanderTso/subscriptions","organizations_url":"https://api.github.com/users/CommanderTso/orgs","repos_url":"https://api.github.com/users/CommanderTso/repos","events_url":"https://api.github.com/users/CommanderTso/events{/privacy}","received_events_url":"https://api.github.com/users/CommanderTso/received_events","type":"User","site_admin":false},"repo":{"id":55425515,"name":"ikea_reviews","full_name":"CommanderTso/ikea_reviews","owner":{"login":"CommanderTso","id":11823614,"avatar_url":"https://avatars.githubusercontent.com/u/11823614?v=3","gravatar_id":"","url":"https://api.github.com/users/CommanderTso","html_url":"https://github.com/CommanderTso","followers_url":"https://api.github.com/users/CommanderTso/followers","following_url":"https://api.github.com/users/CommanderTso/following{/other_user}","gists_url":"https://api.github.com/users/CommanderTso/gists{/gist_id}","starred_url":"https://api.github.com/users/CommanderTso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommanderTso/subscriptions","organizations_url":"https://api.github.com/users/CommanderTso/orgs","repos_url":"https://api.github.com/users/CommanderTso/repos","events_url":"https://api.github.com/users/CommanderTso/events{/privacy}","received_events_url":"https://api.github.com/users/CommanderTso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CommanderTso/ikea_reviews","description":"A Launch Academy team project to create a website hosting Ikea furniture reviews.","fork":false,"url":"https://api.github.com/repos/CommanderTso/ikea_reviews","forks_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/forks","keys_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/teams","hooks_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/hooks","issue_events_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/issues/events{/number}","events_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/events","assignees_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/assignees{/user}","branches_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/branches{/branch}","tags_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/tags","blobs_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/git/refs{/sha}","trees_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/statuses/{sha}","languages_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/languages","stargazers_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/stargazers","contributors_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/contributors","subscribers_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/subscribers","subscription_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/subscription","commits_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/commits{/sha}","git_commits_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/git/commits{/sha}","comments_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/comments{/number}","issue_comment_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/issues/comments{/number}","contents_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/contents/{+path}","compare_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/merges","archive_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/downloads","issues_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/issues{/number}","pulls_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls{/number}","milestones_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/milestones{/number}","notifications_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/labels{/name}","releases_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/releases{/id}","deployments_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/deployments","created_at":"2016-04-04T16:05:43Z","updated_at":"2016-04-04T16:06:20Z","pushed_at":"2016-04-14T21:30:52Z","git_url":"git://github.com/CommanderTso/ikea_reviews.git","ssh_url":"git@github.com:CommanderTso/ikea_reviews.git","clone_url":"https://github.com/CommanderTso/ikea_reviews.git","svn_url":"https://github.com/CommanderTso/ikea_reviews","homepage":null,"size":380,"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":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"CommanderTso:master","ref":"master","sha":"ba758af84fc400b1cb8666734a5d632e28b3bdb7","user":{"login":"CommanderTso","id":11823614,"avatar_url":"https://avatars.githubusercontent.com/u/11823614?v=3","gravatar_id":"","url":"https://api.github.com/users/CommanderTso","html_url":"https://github.com/CommanderTso","followers_url":"https://api.github.com/users/CommanderTso/followers","following_url":"https://api.github.com/users/CommanderTso/following{/other_user}","gists_url":"https://api.github.com/users/CommanderTso/gists{/gist_id}","starred_url":"https://api.github.com/users/CommanderTso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommanderTso/subscriptions","organizations_url":"https://api.github.com/users/CommanderTso/orgs","repos_url":"https://api.github.com/users/CommanderTso/repos","events_url":"https://api.github.com/users/CommanderTso/events{/privacy}","received_events_url":"https://api.github.com/users/CommanderTso/received_events","type":"User","site_admin":false},"repo":{"id":55425515,"name":"ikea_reviews","full_name":"CommanderTso/ikea_reviews","owner":{"login":"CommanderTso","id":11823614,"avatar_url":"https://avatars.githubusercontent.com/u/11823614?v=3","gravatar_id":"","url":"https://api.github.com/users/CommanderTso","html_url":"https://github.com/CommanderTso","followers_url":"https://api.github.com/users/CommanderTso/followers","following_url":"https://api.github.com/users/CommanderTso/following{/other_user}","gists_url":"https://api.github.com/users/CommanderTso/gists{/gist_id}","starred_url":"https://api.github.com/users/CommanderTso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommanderTso/subscriptions","organizations_url":"https://api.github.com/users/CommanderTso/orgs","repos_url":"https://api.github.com/users/CommanderTso/repos","events_url":"https://api.github.com/users/CommanderTso/events{/privacy}","received_events_url":"https://api.github.com/users/CommanderTso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CommanderTso/ikea_reviews","description":"A Launch Academy team project to create a website hosting Ikea furniture reviews.","fork":false,"url":"https://api.github.com/repos/CommanderTso/ikea_reviews","forks_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/forks","keys_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/teams","hooks_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/hooks","issue_events_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/issues/events{/number}","events_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/events","assignees_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/assignees{/user}","branches_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/branches{/branch}","tags_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/tags","blobs_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/git/refs{/sha}","trees_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/statuses/{sha}","languages_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/languages","stargazers_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/stargazers","contributors_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/contributors","subscribers_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/subscribers","subscription_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/subscription","commits_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/commits{/sha}","git_commits_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/git/commits{/sha}","comments_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/comments{/number}","issue_comment_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/issues/comments{/number}","contents_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/contents/{+path}","compare_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/merges","archive_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/downloads","issues_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/issues{/number}","pulls_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls{/number}","milestones_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/milestones{/number}","notifications_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/labels{/name}","releases_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/releases{/id}","deployments_url":"https://api.github.com/repos/CommanderTso/ikea_reviews/deployments","created_at":"2016-04-04T16:05:43Z","updated_at":"2016-04-04T16:06:20Z","pushed_at":"2016-04-14T21:30:52Z","git_url":"git://github.com/CommanderTso/ikea_reviews.git","ssh_url":"git@github.com:CommanderTso/ikea_reviews.git","clone_url":"https://github.com/CommanderTso/ikea_reviews.git","svn_url":"https://github.com/CommanderTso/ikea_reviews","homepage":null,"size":380,"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":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/19"},"html":{"href":"https://github.com/CommanderTso/ikea_reviews/pull/19"},"issue":{"href":"https://api.github.com/repos/CommanderTso/ikea_reviews/issues/19"},"comments":{"href":"https://api.github.com/repos/CommanderTso/ikea_reviews/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CommanderTso/ikea_reviews/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/CommanderTso/ikea_reviews/statuses/72966898d94c692ff5a02616c8ee64a89daec690"}}}}