{"action":"created","comment":{"url":"https://api.github.com/repos/yalokin/qna/pulls/comments/131068351","pull_request_review_id":54010651,"id":131068351,"diff_hunk":"@@ -0,0 +1,41 @@\n+module Votable\n+  extend ActiveSupport::Concern\n+\n+  included do\n+    has_many :votes, as: :votable\n+  end\n+\n+  def vote(user, direction)\n+    return if voted?(user)\n+\n+    transaction do\n+      votes.create!(user: user, value: direction)\n+      increment!(:rating, direction)","path":"app/models/concerns/votable.rb","position":13,"original_position":13,"commit_id":"3505945b8b449f7c79cbf54f01e3d6de30f536ab","original_commit_id":"3505945b8b449f7c79cbf54f01e3d6de30f536ab","user":{"login":"yalokin","id":20622942,"avatar_url":"https://avatars2.githubusercontent.com/u/20622942?v=4","gravatar_id":"","url":"https://api.github.com/users/yalokin","html_url":"https://github.com/yalokin","followers_url":"https://api.github.com/users/yalokin/followers","following_url":"https://api.github.com/users/yalokin/following{/other_user}","gists_url":"https://api.github.com/users/yalokin/gists{/gist_id}","starred_url":"https://api.github.com/users/yalokin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yalokin/subscriptions","organizations_url":"https://api.github.com/users/yalokin/orgs","repos_url":"https://api.github.com/users/yalokin/repos","events_url":"https://api.github.com/users/yalokin/events{/privacy}","received_events_url":"https://api.github.com/users/yalokin/received_events","type":"User","site_admin":false},"body":"Важное замечание, видел использование этого метода, но конструкция self.class.decrement_counter(:rating, self) вызывала недоумение","created_at":"2017-08-03T07:17:59Z","updated_at":"2017-08-03T07:17:59Z","html_url":"https://github.com/yalokin/qna/pull/7#discussion_r131068351","pull_request_url":"https://api.github.com/repos/yalokin/qna/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/yalokin/qna/pulls/comments/131068351"},"html":{"href":"https://github.com/yalokin/qna/pull/7#discussion_r131068351"},"pull_request":{"href":"https://api.github.com/repos/yalokin/qna/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/yalokin/qna/pulls/7","id":133658858,"html_url":"https://github.com/yalokin/qna/pull/7","diff_url":"https://github.com/yalokin/qna/pull/7.diff","patch_url":"https://github.com/yalokin/qna/pull/7.patch","issue_url":"https://api.github.com/repos/yalokin/qna/issues/7","number":7,"state":"open","locked":false,"title":"Other ajax","user":{"login":"yalokin","id":20622942,"avatar_url":"https://avatars2.githubusercontent.com/u/20622942?v=4","gravatar_id":"","url":"https://api.github.com/users/yalokin","html_url":"https://github.com/yalokin","followers_url":"https://api.github.com/users/yalokin/followers","following_url":"https://api.github.com/users/yalokin/following{/other_user}","gists_url":"https://api.github.com/users/yalokin/gists{/gist_id}","starred_url":"https://api.github.com/users/yalokin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yalokin/subscriptions","organizations_url":"https://api.github.com/users/yalokin/orgs","repos_url":"https://api.github.com/users/yalokin/repos","events_url":"https://api.github.com/users/yalokin/events{/privacy}","received_events_url":"https://api.github.com/users/yalokin/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-08-02T09:16:11Z","updated_at":"2017-08-03T07:17:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1175e8d8a336109f77941a61ffcfc7c1e3b51a0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/yalokin/qna/pulls/7/commits","review_comments_url":"https://api.github.com/repos/yalokin/qna/pulls/7/comments","review_comment_url":"https://api.github.com/repos/yalokin/qna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yalokin/qna/issues/7/comments","statuses_url":"https://api.github.com/repos/yalokin/qna/statuses/3505945b8b449f7c79cbf54f01e3d6de30f536ab","head":{"label":"yalokin:other-ajax","ref":"other-ajax","sha":"3505945b8b449f7c79cbf54f01e3d6de30f536ab","user":{"login":"yalokin","id":20622942,"avatar_url":"https://avatars2.githubusercontent.com/u/20622942?v=4","gravatar_id":"","url":"https://api.github.com/users/yalokin","html_url":"https://github.com/yalokin","followers_url":"https://api.github.com/users/yalokin/followers","following_url":"https://api.github.com/users/yalokin/following{/other_user}","gists_url":"https://api.github.com/users/yalokin/gists{/gist_id}","starred_url":"https://api.github.com/users/yalokin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yalokin/subscriptions","organizations_url":"https://api.github.com/users/yalokin/orgs","repos_url":"https://api.github.com/users/yalokin/repos","events_url":"https://api.github.com/users/yalokin/events{/privacy}","received_events_url":"https://api.github.com/users/yalokin/received_events","type":"User","site_admin":false},"repo":{"id":93315014,"name":"qna","full_name":"yalokin/qna","owner":{"login":"yalokin","id":20622942,"avatar_url":"https://avatars2.githubusercontent.com/u/20622942?v=4","gravatar_id":"","url":"https://api.github.com/users/yalokin","html_url":"https://github.com/yalokin","followers_url":"https://api.github.com/users/yalokin/followers","following_url":"https://api.github.com/users/yalokin/following{/other_user}","gists_url":"https://api.github.com/users/yalokin/gists{/gist_id}","starred_url":"https://api.github.com/users/yalokin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yalokin/subscriptions","organizations_url":"https://api.github.com/users/yalokin/orgs","repos_url":"https://api.github.com/users/yalokin/repos","events_url":"https://api.github.com/users/yalokin/events{/privacy}","received_events_url":"https://api.github.com/users/yalokin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yalokin/qna","description":null,"fork":false,"url":"https://api.github.com/repos/yalokin/qna","forks_url":"https://api.github.com/repos/yalokin/qna/forks","keys_url":"https://api.github.com/repos/yalokin/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yalokin/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yalokin/qna/teams","hooks_url":"https://api.github.com/repos/yalokin/qna/hooks","issue_events_url":"https://api.github.com/repos/yalokin/qna/issues/events{/number}","events_url":"https://api.github.com/repos/yalokin/qna/events","assignees_url":"https://api.github.com/repos/yalokin/qna/assignees{/user}","branches_url":"https://api.github.com/repos/yalokin/qna/branches{/branch}","tags_url":"https://api.github.com/repos/yalokin/qna/tags","blobs_url":"https://api.github.com/repos/yalokin/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yalokin/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yalokin/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/yalokin/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yalokin/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/yalokin/qna/languages","stargazers_url":"https://api.github.com/repos/yalokin/qna/stargazers","contributors_url":"https://api.github.com/repos/yalokin/qna/contributors","subscribers_url":"https://api.github.com/repos/yalokin/qna/subscribers","subscription_url":"https://api.github.com/repos/yalokin/qna/subscription","commits_url":"https://api.github.com/repos/yalokin/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/yalokin/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/yalokin/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/yalokin/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/yalokin/qna/contents/{+path}","compare_url":"https://api.github.com/repos/yalokin/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yalokin/qna/merges","archive_url":"https://api.github.com/repos/yalokin/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yalokin/qna/downloads","issues_url":"https://api.github.com/repos/yalokin/qna/issues{/number}","pulls_url":"https://api.github.com/repos/yalokin/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/yalokin/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/yalokin/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yalokin/qna/labels{/name}","releases_url":"https://api.github.com/repos/yalokin/qna/releases{/id}","deployments_url":"https://api.github.com/repos/yalokin/qna/deployments","created_at":"2017-06-04T13:24:45Z","updated_at":"2017-06-04T13:56:39Z","pushed_at":"2017-08-02T14:07:15Z","git_url":"git://github.com/yalokin/qna.git","ssh_url":"git@github.com:yalokin/qna.git","clone_url":"https://github.com/yalokin/qna.git","svn_url":"https://github.com/yalokin/qna","homepage":null,"size":326,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":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":"yalokin:master","ref":"master","sha":"f67c3a0e02c837bf968039761210fbdfdaa17d6f","user":{"login":"yalokin","id":20622942,"avatar_url":"https://avatars2.githubusercontent.com/u/20622942?v=4","gravatar_id":"","url":"https://api.github.com/users/yalokin","html_url":"https://github.com/yalokin","followers_url":"https://api.github.com/users/yalokin/followers","following_url":"https://api.github.com/users/yalokin/following{/other_user}","gists_url":"https://api.github.com/users/yalokin/gists{/gist_id}","starred_url":"https://api.github.com/users/yalokin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yalokin/subscriptions","organizations_url":"https://api.github.com/users/yalokin/orgs","repos_url":"https://api.github.com/users/yalokin/repos","events_url":"https://api.github.com/users/yalokin/events{/privacy}","received_events_url":"https://api.github.com/users/yalokin/received_events","type":"User","site_admin":false},"repo":{"id":93315014,"name":"qna","full_name":"yalokin/qna","owner":{"login":"yalokin","id":20622942,"avatar_url":"https://avatars2.githubusercontent.com/u/20622942?v=4","gravatar_id":"","url":"https://api.github.com/users/yalokin","html_url":"https://github.com/yalokin","followers_url":"https://api.github.com/users/yalokin/followers","following_url":"https://api.github.com/users/yalokin/following{/other_user}","gists_url":"https://api.github.com/users/yalokin/gists{/gist_id}","starred_url":"https://api.github.com/users/yalokin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yalokin/subscriptions","organizations_url":"https://api.github.com/users/yalokin/orgs","repos_url":"https://api.github.com/users/yalokin/repos","events_url":"https://api.github.com/users/yalokin/events{/privacy}","received_events_url":"https://api.github.com/users/yalokin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yalokin/qna","description":null,"fork":false,"url":"https://api.github.com/repos/yalokin/qna","forks_url":"https://api.github.com/repos/yalokin/qna/forks","keys_url":"https://api.github.com/repos/yalokin/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yalokin/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yalokin/qna/teams","hooks_url":"https://api.github.com/repos/yalokin/qna/hooks","issue_events_url":"https://api.github.com/repos/yalokin/qna/issues/events{/number}","events_url":"https://api.github.com/repos/yalokin/qna/events","assignees_url":"https://api.github.com/repos/yalokin/qna/assignees{/user}","branches_url":"https://api.github.com/repos/yalokin/qna/branches{/branch}","tags_url":"https://api.github.com/repos/yalokin/qna/tags","blobs_url":"https://api.github.com/repos/yalokin/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yalokin/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yalokin/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/yalokin/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yalokin/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/yalokin/qna/languages","stargazers_url":"https://api.github.com/repos/yalokin/qna/stargazers","contributors_url":"https://api.github.com/repos/yalokin/qna/contributors","subscribers_url":"https://api.github.com/repos/yalokin/qna/subscribers","subscription_url":"https://api.github.com/repos/yalokin/qna/subscription","commits_url":"https://api.github.com/repos/yalokin/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/yalokin/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/yalokin/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/yalokin/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/yalokin/qna/contents/{+path}","compare_url":"https://api.github.com/repos/yalokin/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yalokin/qna/merges","archive_url":"https://api.github.com/repos/yalokin/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yalokin/qna/downloads","issues_url":"https://api.github.com/repos/yalokin/qna/issues{/number}","pulls_url":"https://api.github.com/repos/yalokin/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/yalokin/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/yalokin/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yalokin/qna/labels{/name}","releases_url":"https://api.github.com/repos/yalokin/qna/releases{/id}","deployments_url":"https://api.github.com/repos/yalokin/qna/deployments","created_at":"2017-06-04T13:24:45Z","updated_at":"2017-06-04T13:56:39Z","pushed_at":"2017-08-02T14:07:15Z","git_url":"git://github.com/yalokin/qna.git","ssh_url":"git@github.com:yalokin/qna.git","clone_url":"https://github.com/yalokin/qna.git","svn_url":"https://github.com/yalokin/qna","homepage":null,"size":326,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":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/yalokin/qna/pulls/7"},"html":{"href":"https://github.com/yalokin/qna/pull/7"},"issue":{"href":"https://api.github.com/repos/yalokin/qna/issues/7"},"comments":{"href":"https://api.github.com/repos/yalokin/qna/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/yalokin/qna/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/yalokin/qna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yalokin/qna/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/yalokin/qna/statuses/3505945b8b449f7c79cbf54f01e3d6de30f536ab"}}}}
{"actor":{"display_login":"yalokin"}}