{"action":"created","comment":{"url":"https://api.github.com/repos/khataev/qna/pulls/comments/57691676","id":57691676,"diff_hunk":"@@ -7,18 +7,20 @@ module Voted\n   end\n \n   def vote_for\n-    if votable_variable.vote_for(current_user)\n-      render json: votable_variable\n+    if votable_variable.user_voted?(current_user)\n+      render json: { errors: 'You can vote only once' }, status: :unprocessable_entity\n     else\n-      render json: votable_variable.errors.full_messages, status: :unprocessable_entity\n+      votable_variable.vote_for(current_user)\n+      render json: votable_variable\n     end\n   end\n \n   def vote_against\n-    if votable_variable.vote_against(current_user)\n-      render json: votable_variable\n+    if votable_variable.user_voted?(current_user)\n+      render json: { errors: 'You can vote only once' }, status: :unprocessable_entity","path":"app/controllers/concerns/voted.rb","position":19,"original_position":19,"commit_id":"24d9c96be29270279b8afec37c336703737a32dd","original_commit_id":"24d9c96be29270279b8afec37c336703737a32dd","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":"Статус должен быть forbidden (403)","created_at":"2016-03-29T09:02:25Z","updated_at":"2016-03-29T09:02:25Z","html_url":"https://github.com/khataev/qna/pull/11#discussion_r57691676","pull_request_url":"https://api.github.com/repos/khataev/qna/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/khataev/qna/pulls/comments/57691676"},"html":{"href":"https://github.com/khataev/qna/pull/11#discussion_r57691676"},"pull_request":{"href":"https://api.github.com/repos/khataev/qna/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/khataev/qna/pulls/11","id":64357891,"html_url":"https://github.com/khataev/qna/pull/11","diff_url":"https://github.com/khataev/qna/pull/11.diff","patch_url":"https://github.com/khataev/qna/pull/11.patch","issue_url":"https://api.github.com/repos/khataev/qna/issues/11","number":11,"state":"open","locked":false,"title":"lesson 13","user":{"login":"khataev","id":5956518,"avatar_url":"https://avatars.githubusercontent.com/u/5956518?v=3","gravatar_id":"","url":"https://api.github.com/users/khataev","html_url":"https://github.com/khataev","followers_url":"https://api.github.com/users/khataev/followers","following_url":"https://api.github.com/users/khataev/following{/other_user}","gists_url":"https://api.github.com/users/khataev/gists{/gist_id}","starred_url":"https://api.github.com/users/khataev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khataev/subscriptions","organizations_url":"https://api.github.com/users/khataev/orgs","repos_url":"https://api.github.com/users/khataev/repos","events_url":"https://api.github.com/users/khataev/events{/privacy}","received_events_url":"https://api.github.com/users/khataev/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-03-28T18:51:18Z","updated_at":"2016-03-29T09:02:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bd853b1ce76b086004af24fe25227b9ae4958db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/khataev/qna/pulls/11/commits","review_comments_url":"https://api.github.com/repos/khataev/qna/pulls/11/comments","review_comment_url":"https://api.github.com/repos/khataev/qna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/khataev/qna/issues/11/comments","statuses_url":"https://api.github.com/repos/khataev/qna/statuses/24d9c96be29270279b8afec37c336703737a32dd","head":{"label":"khataev:lesson13","ref":"lesson13","sha":"24d9c96be29270279b8afec37c336703737a32dd","user":{"login":"khataev","id":5956518,"avatar_url":"https://avatars.githubusercontent.com/u/5956518?v=3","gravatar_id":"","url":"https://api.github.com/users/khataev","html_url":"https://github.com/khataev","followers_url":"https://api.github.com/users/khataev/followers","following_url":"https://api.github.com/users/khataev/following{/other_user}","gists_url":"https://api.github.com/users/khataev/gists{/gist_id}","starred_url":"https://api.github.com/users/khataev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khataev/subscriptions","organizations_url":"https://api.github.com/users/khataev/orgs","repos_url":"https://api.github.com/users/khataev/repos","events_url":"https://api.github.com/users/khataev/events{/privacy}","received_events_url":"https://api.github.com/users/khataev/received_events","type":"User","site_admin":false},"repo":{"id":49897323,"name":"qna","full_name":"khataev/qna","owner":{"login":"khataev","id":5956518,"avatar_url":"https://avatars.githubusercontent.com/u/5956518?v=3","gravatar_id":"","url":"https://api.github.com/users/khataev","html_url":"https://github.com/khataev","followers_url":"https://api.github.com/users/khataev/followers","following_url":"https://api.github.com/users/khataev/following{/other_user}","gists_url":"https://api.github.com/users/khataev/gists{/gist_id}","starred_url":"https://api.github.com/users/khataev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khataev/subscriptions","organizations_url":"https://api.github.com/users/khataev/orgs","repos_url":"https://api.github.com/users/khataev/repos","events_url":"https://api.github.com/users/khataev/events{/privacy}","received_events_url":"https://api.github.com/users/khataev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/khataev/qna","description":"My study clone of StackOverflow","fork":false,"url":"https://api.github.com/repos/khataev/qna","forks_url":"https://api.github.com/repos/khataev/qna/forks","keys_url":"https://api.github.com/repos/khataev/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/khataev/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/khataev/qna/teams","hooks_url":"https://api.github.com/repos/khataev/qna/hooks","issue_events_url":"https://api.github.com/repos/khataev/qna/issues/events{/number}","events_url":"https://api.github.com/repos/khataev/qna/events","assignees_url":"https://api.github.com/repos/khataev/qna/assignees{/user}","branches_url":"https://api.github.com/repos/khataev/qna/branches{/branch}","tags_url":"https://api.github.com/repos/khataev/qna/tags","blobs_url":"https://api.github.com/repos/khataev/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/khataev/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/khataev/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/khataev/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/khataev/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/khataev/qna/languages","stargazers_url":"https://api.github.com/repos/khataev/qna/stargazers","contributors_url":"https://api.github.com/repos/khataev/qna/contributors","subscribers_url":"https://api.github.com/repos/khataev/qna/subscribers","subscription_url":"https://api.github.com/repos/khataev/qna/subscription","commits_url":"https://api.github.com/repos/khataev/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/khataev/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/khataev/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/khataev/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/khataev/qna/contents/{+path}","compare_url":"https://api.github.com/repos/khataev/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/khataev/qna/merges","archive_url":"https://api.github.com/repos/khataev/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/khataev/qna/downloads","issues_url":"https://api.github.com/repos/khataev/qna/issues{/number}","pulls_url":"https://api.github.com/repos/khataev/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/khataev/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/khataev/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/khataev/qna/labels{/name}","releases_url":"https://api.github.com/repos/khataev/qna/releases{/id}","deployments_url":"https://api.github.com/repos/khataev/qna/deployments","created_at":"2016-01-18T18:45:42Z","updated_at":"2016-02-08T03:55:15Z","pushed_at":"2016-03-28T18:51:18Z","git_url":"git://github.com/khataev/qna.git","ssh_url":"git@github.com:khataev/qna.git","clone_url":"https://github.com/khataev/qna.git","svn_url":"https://github.com/khataev/qna","homepage":null,"size":236,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"khataev:master","ref":"master","sha":"64a691a46a746b6fdc47ac7848e33a8114cbfbe8","user":{"login":"khataev","id":5956518,"avatar_url":"https://avatars.githubusercontent.com/u/5956518?v=3","gravatar_id":"","url":"https://api.github.com/users/khataev","html_url":"https://github.com/khataev","followers_url":"https://api.github.com/users/khataev/followers","following_url":"https://api.github.com/users/khataev/following{/other_user}","gists_url":"https://api.github.com/users/khataev/gists{/gist_id}","starred_url":"https://api.github.com/users/khataev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khataev/subscriptions","organizations_url":"https://api.github.com/users/khataev/orgs","repos_url":"https://api.github.com/users/khataev/repos","events_url":"https://api.github.com/users/khataev/events{/privacy}","received_events_url":"https://api.github.com/users/khataev/received_events","type":"User","site_admin":false},"repo":{"id":49897323,"name":"qna","full_name":"khataev/qna","owner":{"login":"khataev","id":5956518,"avatar_url":"https://avatars.githubusercontent.com/u/5956518?v=3","gravatar_id":"","url":"https://api.github.com/users/khataev","html_url":"https://github.com/khataev","followers_url":"https://api.github.com/users/khataev/followers","following_url":"https://api.github.com/users/khataev/following{/other_user}","gists_url":"https://api.github.com/users/khataev/gists{/gist_id}","starred_url":"https://api.github.com/users/khataev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khataev/subscriptions","organizations_url":"https://api.github.com/users/khataev/orgs","repos_url":"https://api.github.com/users/khataev/repos","events_url":"https://api.github.com/users/khataev/events{/privacy}","received_events_url":"https://api.github.com/users/khataev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/khataev/qna","description":"My study clone of StackOverflow","fork":false,"url":"https://api.github.com/repos/khataev/qna","forks_url":"https://api.github.com/repos/khataev/qna/forks","keys_url":"https://api.github.com/repos/khataev/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/khataev/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/khataev/qna/teams","hooks_url":"https://api.github.com/repos/khataev/qna/hooks","issue_events_url":"https://api.github.com/repos/khataev/qna/issues/events{/number}","events_url":"https://api.github.com/repos/khataev/qna/events","assignees_url":"https://api.github.com/repos/khataev/qna/assignees{/user}","branches_url":"https://api.github.com/repos/khataev/qna/branches{/branch}","tags_url":"https://api.github.com/repos/khataev/qna/tags","blobs_url":"https://api.github.com/repos/khataev/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/khataev/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/khataev/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/khataev/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/khataev/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/khataev/qna/languages","stargazers_url":"https://api.github.com/repos/khataev/qna/stargazers","contributors_url":"https://api.github.com/repos/khataev/qna/contributors","subscribers_url":"https://api.github.com/repos/khataev/qna/subscribers","subscription_url":"https://api.github.com/repos/khataev/qna/subscription","commits_url":"https://api.github.com/repos/khataev/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/khataev/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/khataev/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/khataev/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/khataev/qna/contents/{+path}","compare_url":"https://api.github.com/repos/khataev/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/khataev/qna/merges","archive_url":"https://api.github.com/repos/khataev/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/khataev/qna/downloads","issues_url":"https://api.github.com/repos/khataev/qna/issues{/number}","pulls_url":"https://api.github.com/repos/khataev/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/khataev/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/khataev/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/khataev/qna/labels{/name}","releases_url":"https://api.github.com/repos/khataev/qna/releases{/id}","deployments_url":"https://api.github.com/repos/khataev/qna/deployments","created_at":"2016-01-18T18:45:42Z","updated_at":"2016-02-08T03:55:15Z","pushed_at":"2016-03-28T18:51:18Z","git_url":"git://github.com/khataev/qna.git","ssh_url":"git@github.com:khataev/qna.git","clone_url":"https://github.com/khataev/qna.git","svn_url":"https://github.com/khataev/qna","homepage":null,"size":236,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/khataev/qna/pulls/11"},"html":{"href":"https://github.com/khataev/qna/pull/11"},"issue":{"href":"https://api.github.com/repos/khataev/qna/issues/11"},"comments":{"href":"https://api.github.com/repos/khataev/qna/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/khataev/qna/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/khataev/qna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/khataev/qna/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/khataev/qna/statuses/24d9c96be29270279b8afec37c336703737a32dd"}}}}