{"action":"created","comment":{"url":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/comments/43299646","id":43299646,"diff_hunk":"@@ -0,0 +1,67 @@\n+require_dependency \"flyover_comments/application_controller\"\n+require_dependency \"flyover_comments/authorization\"\n+\n+module FlyoverComments\n+  class VotesController < ApplicationController\n+    include FlyoverComments::Authorization\n+\n+    respond_to :json, only: [:create, :destroy]\n+\n+    before_action :load_vote, only: [:update, :destroy]\n+\n+    def create\n+      @comment = FlyoverComments::Comment.find(params[:comment_id])\n+      authorize_flyover_vote_create!\n+      @vote = @comment.votes.new(value: params[:value])\n+      @vote._user = send(FlyoverComments.current_user_method.to_sym)\n+\n+      if @vote.save\n+        @comment.recalculate_vote_counts!","path":"app/controllers/flyover_comments/votes_controller.rb","position":19,"original_position":19,"commit_id":"464dfebfb781e13df47481cf11133626a4266b67","original_commit_id":"464dfebfb781e13df47481cf11133626a4266b67","user":{"login":"jackschultz","id":1147125,"avatar_url":"https://avatars.githubusercontent.com/u/1147125?v=3","gravatar_id":"","url":"https://api.github.com/users/jackschultz","html_url":"https://github.com/jackschultz","followers_url":"https://api.github.com/users/jackschultz/followers","following_url":"https://api.github.com/users/jackschultz/following{/other_user}","gists_url":"https://api.github.com/users/jackschultz/gists{/gist_id}","starred_url":"https://api.github.com/users/jackschultz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackschultz/subscriptions","organizations_url":"https://api.github.com/users/jackschultz/orgs","repos_url":"https://api.github.com/users/jackschultz/repos","events_url":"https://api.github.com/users/jackschultz/events{/privacy}","received_events_url":"https://api.github.com/users/jackschultz/received_events","type":"User","site_admin":false},"body":"Probably doesn't need to be in the save. Also there are some annoyances with updating the votes count for each of these if we'd increment since we have to know what the old value of that vote is. So I just went with recalculate on each for now.","created_at":"2015-10-28T18:39:53Z","updated_at":"2015-10-28T18:39:53Z","html_url":"https://github.com/CultivateLabs/flyover_comments/pull/16#discussion_r43299646","pull_request_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/comments/43299646"},"html":{"href":"https://github.com/CultivateLabs/flyover_comments/pull/16#discussion_r43299646"},"pull_request":{"href":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/16","id":49048221,"html_url":"https://github.com/CultivateLabs/flyover_comments/pull/16","diff_url":"https://github.com/CultivateLabs/flyover_comments/pull/16.diff","patch_url":"https://github.com/CultivateLabs/flyover_comments/pull/16.patch","issue_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/issues/16","number":16,"state":"open","locked":false,"title":"Feature votes","user":{"login":"jackschultz","id":1147125,"avatar_url":"https://avatars.githubusercontent.com/u/1147125?v=3","gravatar_id":"","url":"https://api.github.com/users/jackschultz","html_url":"https://github.com/jackschultz","followers_url":"https://api.github.com/users/jackschultz/followers","following_url":"https://api.github.com/users/jackschultz/following{/other_user}","gists_url":"https://api.github.com/users/jackschultz/gists{/gist_id}","starred_url":"https://api.github.com/users/jackschultz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackschultz/subscriptions","organizations_url":"https://api.github.com/users/jackschultz/orgs","repos_url":"https://api.github.com/users/jackschultz/repos","events_url":"https://api.github.com/users/jackschultz/events{/privacy}","received_events_url":"https://api.github.com/users/jackschultz/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-28T18:33:36Z","updated_at":"2015-10-28T18:39:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f14fca9236b8f8e68d24e95b97bcfa1bfca5649e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/16/commits","review_comments_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/16/comments","review_comment_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/issues/16/comments","statuses_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/statuses/464dfebfb781e13df47481cf11133626a4266b67","head":{"label":"CultivateLabs:feature/votes","ref":"feature/votes","sha":"464dfebfb781e13df47481cf11133626a4266b67","user":{"login":"CultivateLabs","id":7969928,"avatar_url":"https://avatars.githubusercontent.com/u/7969928?v=3","gravatar_id":"","url":"https://api.github.com/users/CultivateLabs","html_url":"https://github.com/CultivateLabs","followers_url":"https://api.github.com/users/CultivateLabs/followers","following_url":"https://api.github.com/users/CultivateLabs/following{/other_user}","gists_url":"https://api.github.com/users/CultivateLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/CultivateLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CultivateLabs/subscriptions","organizations_url":"https://api.github.com/users/CultivateLabs/orgs","repos_url":"https://api.github.com/users/CultivateLabs/repos","events_url":"https://api.github.com/users/CultivateLabs/events{/privacy}","received_events_url":"https://api.github.com/users/CultivateLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":28942994,"name":"flyover_comments","full_name":"CultivateLabs/flyover_comments","owner":{"login":"CultivateLabs","id":7969928,"avatar_url":"https://avatars.githubusercontent.com/u/7969928?v=3","gravatar_id":"","url":"https://api.github.com/users/CultivateLabs","html_url":"https://github.com/CultivateLabs","followers_url":"https://api.github.com/users/CultivateLabs/followers","following_url":"https://api.github.com/users/CultivateLabs/following{/other_user}","gists_url":"https://api.github.com/users/CultivateLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/CultivateLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CultivateLabs/subscriptions","organizations_url":"https://api.github.com/users/CultivateLabs/orgs","repos_url":"https://api.github.com/users/CultivateLabs/repos","events_url":"https://api.github.com/users/CultivateLabs/events{/privacy}","received_events_url":"https://api.github.com/users/CultivateLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CultivateLabs/flyover_comments","description":"FlyoverComments is a Rails engine that provides full-stack commenting capabilities. It is built and maintained by @cultivatelabs","fork":false,"url":"https://api.github.com/repos/CultivateLabs/flyover_comments","forks_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/forks","keys_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/teams","hooks_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/hooks","issue_events_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/issues/events{/number}","events_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/events","assignees_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/assignees{/user}","branches_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/branches{/branch}","tags_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/tags","blobs_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/git/refs{/sha}","trees_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/statuses/{sha}","languages_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/languages","stargazers_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/stargazers","contributors_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/contributors","subscribers_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/subscribers","subscription_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/subscription","commits_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/commits{/sha}","git_commits_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/git/commits{/sha}","comments_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/comments{/number}","issue_comment_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/issues/comments{/number}","contents_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/contents/{+path}","compare_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/merges","archive_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/downloads","issues_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/issues{/number}","pulls_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls{/number}","milestones_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/milestones{/number}","notifications_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/labels{/name}","releases_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/releases{/id}","created_at":"2015-01-08T01:35:45Z","updated_at":"2015-09-16T00:42:34Z","pushed_at":"2015-10-28T18:33:37Z","git_url":"git://github.com/CultivateLabs/flyover_comments.git","ssh_url":"git@github.com:CultivateLabs/flyover_comments.git","clone_url":"https://github.com/CultivateLabs/flyover_comments.git","svn_url":"https://github.com/CultivateLabs/flyover_comments","homepage":"","size":660,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"CultivateLabs:master","ref":"master","sha":"2296707036559b074c10d6d55871caaa4f2d5ab9","user":{"login":"CultivateLabs","id":7969928,"avatar_url":"https://avatars.githubusercontent.com/u/7969928?v=3","gravatar_id":"","url":"https://api.github.com/users/CultivateLabs","html_url":"https://github.com/CultivateLabs","followers_url":"https://api.github.com/users/CultivateLabs/followers","following_url":"https://api.github.com/users/CultivateLabs/following{/other_user}","gists_url":"https://api.github.com/users/CultivateLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/CultivateLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CultivateLabs/subscriptions","organizations_url":"https://api.github.com/users/CultivateLabs/orgs","repos_url":"https://api.github.com/users/CultivateLabs/repos","events_url":"https://api.github.com/users/CultivateLabs/events{/privacy}","received_events_url":"https://api.github.com/users/CultivateLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":28942994,"name":"flyover_comments","full_name":"CultivateLabs/flyover_comments","owner":{"login":"CultivateLabs","id":7969928,"avatar_url":"https://avatars.githubusercontent.com/u/7969928?v=3","gravatar_id":"","url":"https://api.github.com/users/CultivateLabs","html_url":"https://github.com/CultivateLabs","followers_url":"https://api.github.com/users/CultivateLabs/followers","following_url":"https://api.github.com/users/CultivateLabs/following{/other_user}","gists_url":"https://api.github.com/users/CultivateLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/CultivateLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CultivateLabs/subscriptions","organizations_url":"https://api.github.com/users/CultivateLabs/orgs","repos_url":"https://api.github.com/users/CultivateLabs/repos","events_url":"https://api.github.com/users/CultivateLabs/events{/privacy}","received_events_url":"https://api.github.com/users/CultivateLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CultivateLabs/flyover_comments","description":"FlyoverComments is a Rails engine that provides full-stack commenting capabilities. It is built and maintained by @cultivatelabs","fork":false,"url":"https://api.github.com/repos/CultivateLabs/flyover_comments","forks_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/forks","keys_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/teams","hooks_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/hooks","issue_events_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/issues/events{/number}","events_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/events","assignees_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/assignees{/user}","branches_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/branches{/branch}","tags_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/tags","blobs_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/git/refs{/sha}","trees_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/statuses/{sha}","languages_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/languages","stargazers_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/stargazers","contributors_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/contributors","subscribers_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/subscribers","subscription_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/subscription","commits_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/commits{/sha}","git_commits_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/git/commits{/sha}","comments_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/comments{/number}","issue_comment_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/issues/comments{/number}","contents_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/contents/{+path}","compare_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/merges","archive_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/downloads","issues_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/issues{/number}","pulls_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls{/number}","milestones_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/milestones{/number}","notifications_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/labels{/name}","releases_url":"https://api.github.com/repos/CultivateLabs/flyover_comments/releases{/id}","created_at":"2015-01-08T01:35:45Z","updated_at":"2015-09-16T00:42:34Z","pushed_at":"2015-10-28T18:33:37Z","git_url":"git://github.com/CultivateLabs/flyover_comments.git","ssh_url":"git@github.com:CultivateLabs/flyover_comments.git","clone_url":"https://github.com/CultivateLabs/flyover_comments.git","svn_url":"https://github.com/CultivateLabs/flyover_comments","homepage":"","size":660,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/16"},"html":{"href":"https://github.com/CultivateLabs/flyover_comments/pull/16"},"issue":{"href":"https://api.github.com/repos/CultivateLabs/flyover_comments/issues/16"},"comments":{"href":"https://api.github.com/repos/CultivateLabs/flyover_comments/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CultivateLabs/flyover_comments/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/CultivateLabs/flyover_comments/statuses/464dfebfb781e13df47481cf11133626a4266b67"}}}}