{"action":"created","comment":{"url":"https://api.github.com/repos/webmstk/qaa/pulls/comments/36064791","id":36064791,"diff_hunk":"@@ -0,0 +1,82 @@\n+class VotesController < ApplicationController\n+  before_action :authenticate_user!\n+  before_action :load_votable\n+\n+  def like\n+    if @votable.user_id != current_user.id\n+      vote = Vote.find_by(votable_id: params[:vote_id], votable_type: params[:votable_type], user_id: current_user)\n+\n+      if !vote","path":"app/controllers/votes_controller.rb","position":9,"original_position":9,"commit_id":"80faa19129af45af9c30e942b1f437fedc55c0aa","original_commit_id":"80faa19129af45af9c30e942b1f437fedc55c0aa","user":{"login":"vkurennov","id":968537,"avatar_url":"https://avatars.githubusercontent.com/u/968537?v=3","gravatar_id":"","url":"https://api.github.com/users/vkurennov","html_url":"https://github.com/vkurennov","followers_url":"https://api.github.com/users/vkurennov/followers","following_url":"https://api.github.com/users/vkurennov/following{/other_user}","gists_url":"https://api.github.com/users/vkurennov/gists{/gist_id}","starred_url":"https://api.github.com/users/vkurennov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkurennov/subscriptions","organizations_url":"https://api.github.com/users/vkurennov/orgs","repos_url":"https://api.github.com/users/vkurennov/repos","events_url":"https://api.github.com/users/vkurennov/events{/privacy}","received_events_url":"https://api.github.com/users/vkurennov/received_events","type":"User","site_admin":false},"body":"Что-то тут явно усложнено, слишко много if-ов (что само по себе уже плохой код).","created_at":"2015-08-03T08:28:01Z","updated_at":"2015-08-03T08:28:01Z","html_url":"https://github.com/webmstk/qaa/pull/7#discussion_r36064791","pull_request_url":"https://api.github.com/repos/webmstk/qaa/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/webmstk/qaa/pulls/comments/36064791"},"html":{"href":"https://github.com/webmstk/qaa/pull/7#discussion_r36064791"},"pull_request":{"href":"https://api.github.com/repos/webmstk/qaa/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/webmstk/qaa/pulls/7","id":41436898,"html_url":"https://github.com/webmstk/qaa/pull/7","diff_url":"https://github.com/webmstk/qaa/pull/7.diff","patch_url":"https://github.com/webmstk/qaa/pull/7.patch","issue_url":"https://api.github.com/repos/webmstk/qaa/issues/7","number":7,"state":"open","locked":false,"title":"do lesson 9","user":{"login":"webmstk","id":10058472,"avatar_url":"https://avatars.githubusercontent.com/u/10058472?v=3","gravatar_id":"","url":"https://api.github.com/users/webmstk","html_url":"https://github.com/webmstk","followers_url":"https://api.github.com/users/webmstk/followers","following_url":"https://api.github.com/users/webmstk/following{/other_user}","gists_url":"https://api.github.com/users/webmstk/gists{/gist_id}","starred_url":"https://api.github.com/users/webmstk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webmstk/subscriptions","organizations_url":"https://api.github.com/users/webmstk/orgs","repos_url":"https://api.github.com/users/webmstk/repos","events_url":"https://api.github.com/users/webmstk/events{/privacy}","received_events_url":"https://api.github.com/users/webmstk/received_events","type":"User","site_admin":false},"body":"Реализована возможность голосования за понравившиеся вопросы/ответы.","created_at":"2015-08-03T05:57:04Z","updated_at":"2015-08-03T08:28:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6df230b2b492f50aa8cd1d7c35f297898b09576c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/webmstk/qaa/pulls/7/commits","review_comments_url":"https://api.github.com/repos/webmstk/qaa/pulls/7/comments","review_comment_url":"https://api.github.com/repos/webmstk/qaa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/webmstk/qaa/issues/7/comments","statuses_url":"https://api.github.com/repos/webmstk/qaa/statuses/80faa19129af45af9c30e942b1f437fedc55c0aa","head":{"label":"webmstk:task9","ref":"task9","sha":"80faa19129af45af9c30e942b1f437fedc55c0aa","user":{"login":"webmstk","id":10058472,"avatar_url":"https://avatars.githubusercontent.com/u/10058472?v=3","gravatar_id":"","url":"https://api.github.com/users/webmstk","html_url":"https://github.com/webmstk","followers_url":"https://api.github.com/users/webmstk/followers","following_url":"https://api.github.com/users/webmstk/following{/other_user}","gists_url":"https://api.github.com/users/webmstk/gists{/gist_id}","starred_url":"https://api.github.com/users/webmstk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webmstk/subscriptions","organizations_url":"https://api.github.com/users/webmstk/orgs","repos_url":"https://api.github.com/users/webmstk/repos","events_url":"https://api.github.com/users/webmstk/events{/privacy}","received_events_url":"https://api.github.com/users/webmstk/received_events","type":"User","site_admin":false},"repo":{"id":36569251,"name":"qaa","full_name":"webmstk/qaa","owner":{"login":"webmstk","id":10058472,"avatar_url":"https://avatars.githubusercontent.com/u/10058472?v=3","gravatar_id":"","url":"https://api.github.com/users/webmstk","html_url":"https://github.com/webmstk","followers_url":"https://api.github.com/users/webmstk/followers","following_url":"https://api.github.com/users/webmstk/following{/other_user}","gists_url":"https://api.github.com/users/webmstk/gists{/gist_id}","starred_url":"https://api.github.com/users/webmstk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webmstk/subscriptions","organizations_url":"https://api.github.com/users/webmstk/orgs","repos_url":"https://api.github.com/users/webmstk/repos","events_url":"https://api.github.com/users/webmstk/events{/privacy}","received_events_url":"https://api.github.com/users/webmstk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/webmstk/qaa","description":"Questions & Answers project","fork":false,"url":"https://api.github.com/repos/webmstk/qaa","forks_url":"https://api.github.com/repos/webmstk/qaa/forks","keys_url":"https://api.github.com/repos/webmstk/qaa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webmstk/qaa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webmstk/qaa/teams","hooks_url":"https://api.github.com/repos/webmstk/qaa/hooks","issue_events_url":"https://api.github.com/repos/webmstk/qaa/issues/events{/number}","events_url":"https://api.github.com/repos/webmstk/qaa/events","assignees_url":"https://api.github.com/repos/webmstk/qaa/assignees{/user}","branches_url":"https://api.github.com/repos/webmstk/qaa/branches{/branch}","tags_url":"https://api.github.com/repos/webmstk/qaa/tags","blobs_url":"https://api.github.com/repos/webmstk/qaa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webmstk/qaa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webmstk/qaa/git/refs{/sha}","trees_url":"https://api.github.com/repos/webmstk/qaa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webmstk/qaa/statuses/{sha}","languages_url":"https://api.github.com/repos/webmstk/qaa/languages","stargazers_url":"https://api.github.com/repos/webmstk/qaa/stargazers","contributors_url":"https://api.github.com/repos/webmstk/qaa/contributors","subscribers_url":"https://api.github.com/repos/webmstk/qaa/subscribers","subscription_url":"https://api.github.com/repos/webmstk/qaa/subscription","commits_url":"https://api.github.com/repos/webmstk/qaa/commits{/sha}","git_commits_url":"https://api.github.com/repos/webmstk/qaa/git/commits{/sha}","comments_url":"https://api.github.com/repos/webmstk/qaa/comments{/number}","issue_comment_url":"https://api.github.com/repos/webmstk/qaa/issues/comments{/number}","contents_url":"https://api.github.com/repos/webmstk/qaa/contents/{+path}","compare_url":"https://api.github.com/repos/webmstk/qaa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webmstk/qaa/merges","archive_url":"https://api.github.com/repos/webmstk/qaa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webmstk/qaa/downloads","issues_url":"https://api.github.com/repos/webmstk/qaa/issues{/number}","pulls_url":"https://api.github.com/repos/webmstk/qaa/pulls{/number}","milestones_url":"https://api.github.com/repos/webmstk/qaa/milestones{/number}","notifications_url":"https://api.github.com/repos/webmstk/qaa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webmstk/qaa/labels{/name}","releases_url":"https://api.github.com/repos/webmstk/qaa/releases{/id}","created_at":"2015-05-30T18:00:10Z","updated_at":"2015-05-30T18:01:36Z","pushed_at":"2015-08-03T05:57:05Z","git_url":"git://github.com/webmstk/qaa.git","ssh_url":"git@github.com:webmstk/qaa.git","clone_url":"https://github.com/webmstk/qaa.git","svn_url":"https://github.com/webmstk/qaa","homepage":null,"size":464,"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":"webmstk:master","ref":"master","sha":"5ea0e985e630be4f79ae4ba41fcf673ed3f3475d","user":{"login":"webmstk","id":10058472,"avatar_url":"https://avatars.githubusercontent.com/u/10058472?v=3","gravatar_id":"","url":"https://api.github.com/users/webmstk","html_url":"https://github.com/webmstk","followers_url":"https://api.github.com/users/webmstk/followers","following_url":"https://api.github.com/users/webmstk/following{/other_user}","gists_url":"https://api.github.com/users/webmstk/gists{/gist_id}","starred_url":"https://api.github.com/users/webmstk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webmstk/subscriptions","organizations_url":"https://api.github.com/users/webmstk/orgs","repos_url":"https://api.github.com/users/webmstk/repos","events_url":"https://api.github.com/users/webmstk/events{/privacy}","received_events_url":"https://api.github.com/users/webmstk/received_events","type":"User","site_admin":false},"repo":{"id":36569251,"name":"qaa","full_name":"webmstk/qaa","owner":{"login":"webmstk","id":10058472,"avatar_url":"https://avatars.githubusercontent.com/u/10058472?v=3","gravatar_id":"","url":"https://api.github.com/users/webmstk","html_url":"https://github.com/webmstk","followers_url":"https://api.github.com/users/webmstk/followers","following_url":"https://api.github.com/users/webmstk/following{/other_user}","gists_url":"https://api.github.com/users/webmstk/gists{/gist_id}","starred_url":"https://api.github.com/users/webmstk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webmstk/subscriptions","organizations_url":"https://api.github.com/users/webmstk/orgs","repos_url":"https://api.github.com/users/webmstk/repos","events_url":"https://api.github.com/users/webmstk/events{/privacy}","received_events_url":"https://api.github.com/users/webmstk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/webmstk/qaa","description":"Questions & Answers project","fork":false,"url":"https://api.github.com/repos/webmstk/qaa","forks_url":"https://api.github.com/repos/webmstk/qaa/forks","keys_url":"https://api.github.com/repos/webmstk/qaa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webmstk/qaa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webmstk/qaa/teams","hooks_url":"https://api.github.com/repos/webmstk/qaa/hooks","issue_events_url":"https://api.github.com/repos/webmstk/qaa/issues/events{/number}","events_url":"https://api.github.com/repos/webmstk/qaa/events","assignees_url":"https://api.github.com/repos/webmstk/qaa/assignees{/user}","branches_url":"https://api.github.com/repos/webmstk/qaa/branches{/branch}","tags_url":"https://api.github.com/repos/webmstk/qaa/tags","blobs_url":"https://api.github.com/repos/webmstk/qaa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webmstk/qaa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webmstk/qaa/git/refs{/sha}","trees_url":"https://api.github.com/repos/webmstk/qaa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webmstk/qaa/statuses/{sha}","languages_url":"https://api.github.com/repos/webmstk/qaa/languages","stargazers_url":"https://api.github.com/repos/webmstk/qaa/stargazers","contributors_url":"https://api.github.com/repos/webmstk/qaa/contributors","subscribers_url":"https://api.github.com/repos/webmstk/qaa/subscribers","subscription_url":"https://api.github.com/repos/webmstk/qaa/subscription","commits_url":"https://api.github.com/repos/webmstk/qaa/commits{/sha}","git_commits_url":"https://api.github.com/repos/webmstk/qaa/git/commits{/sha}","comments_url":"https://api.github.com/repos/webmstk/qaa/comments{/number}","issue_comment_url":"https://api.github.com/repos/webmstk/qaa/issues/comments{/number}","contents_url":"https://api.github.com/repos/webmstk/qaa/contents/{+path}","compare_url":"https://api.github.com/repos/webmstk/qaa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webmstk/qaa/merges","archive_url":"https://api.github.com/repos/webmstk/qaa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webmstk/qaa/downloads","issues_url":"https://api.github.com/repos/webmstk/qaa/issues{/number}","pulls_url":"https://api.github.com/repos/webmstk/qaa/pulls{/number}","milestones_url":"https://api.github.com/repos/webmstk/qaa/milestones{/number}","notifications_url":"https://api.github.com/repos/webmstk/qaa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webmstk/qaa/labels{/name}","releases_url":"https://api.github.com/repos/webmstk/qaa/releases{/id}","created_at":"2015-05-30T18:00:10Z","updated_at":"2015-05-30T18:01:36Z","pushed_at":"2015-08-03T05:57:05Z","git_url":"git://github.com/webmstk/qaa.git","ssh_url":"git@github.com:webmstk/qaa.git","clone_url":"https://github.com/webmstk/qaa.git","svn_url":"https://github.com/webmstk/qaa","homepage":null,"size":464,"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/webmstk/qaa/pulls/7"},"html":{"href":"https://github.com/webmstk/qaa/pull/7"},"issue":{"href":"https://api.github.com/repos/webmstk/qaa/issues/7"},"comments":{"href":"https://api.github.com/repos/webmstk/qaa/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/webmstk/qaa/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/webmstk/qaa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/webmstk/qaa/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/webmstk/qaa/statuses/80faa19129af45af9c30e942b1f437fedc55c0aa"}}}}