{"action":"created","comment":{"url":"https://api.github.com/repos/sleukhin/qna-sample/pulls/comments/30507236","id":30507236,"diff_hunk":"@@ -0,0 +1,11 @@\n+module Reputable\n+  extend ActiveSupport::Concern\n+\n+  private\n+\n+  def update_reputation(object, method, user)","path":"app/models/concerns/reputable.rb","position":6,"original_position":6,"commit_id":"447729b80a75d5a8e2566c1170bf3897c65e4478","original_commit_id":"447729b80a75d5a8e2566c1170bf3897c65e4478","user":{"login":"sleukhin","id":6904800,"avatar_url":"https://avatars.githubusercontent.com/u/6904800?v=3","gravatar_id":"","url":"https://api.github.com/users/sleukhin","html_url":"https://github.com/sleukhin","followers_url":"https://api.github.com/users/sleukhin/followers","following_url":"https://api.github.com/users/sleukhin/following{/other_user}","gists_url":"https://api.github.com/users/sleukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/sleukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleukhin/subscriptions","organizations_url":"https://api.github.com/users/sleukhin/orgs","repos_url":"https://api.github.com/users/sleukhin/repos","events_url":"https://api.github.com/users/sleukhin/events{/privacy}","received_events_url":"https://api.github.com/users/sleukhin/received_events","type":"User","site_admin":false},"body":"Правильно ли я понял что здесь нужно заблокировать пользователя?\r\nТ.е. можно просто обернуть метод следующим образом:\r\n```ruby\r\nuser.with_lock do\r\n  diff = Reputation.calculate(object, method)\r\n  reputation = user.reputation + diff\r\n  user.update(reputation: reputation)\r\nend\r\n```","created_at":"2015-05-18T13:36:21Z","updated_at":"2015-05-18T13:36:21Z","html_url":"https://github.com/sleukhin/qna-sample/pull/16#discussion_r30507236","pull_request_url":"https://api.github.com/repos/sleukhin/qna-sample/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/sleukhin/qna-sample/pulls/comments/30507236"},"html":{"href":"https://github.com/sleukhin/qna-sample/pull/16#discussion_r30507236"},"pull_request":{"href":"https://api.github.com/repos/sleukhin/qna-sample/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/sleukhin/qna-sample/pulls/16","id":35617191,"html_url":"https://github.com/sleukhin/qna-sample/pull/16","diff_url":"https://github.com/sleukhin/qna-sample/pull/16.diff","patch_url":"https://github.com/sleukhin/qna-sample/pull/16.patch","issue_url":"https://api.github.com/repos/sleukhin/qna-sample/issues/16","number":16,"state":"open","locked":false,"title":"Lesson 16","user":{"login":"sleukhin","id":6904800,"avatar_url":"https://avatars.githubusercontent.com/u/6904800?v=3","gravatar_id":"","url":"https://api.github.com/users/sleukhin","html_url":"https://github.com/sleukhin","followers_url":"https://api.github.com/users/sleukhin/followers","following_url":"https://api.github.com/users/sleukhin/following{/other_user}","gists_url":"https://api.github.com/users/sleukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/sleukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleukhin/subscriptions","organizations_url":"https://api.github.com/users/sleukhin/orgs","repos_url":"https://api.github.com/users/sleukhin/repos","events_url":"https://api.github.com/users/sleukhin/events{/privacy}","received_events_url":"https://api.github.com/users/sleukhin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-18T09:45:59Z","updated_at":"2015-05-18T13:36:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7da6de08b2ec38f88bb48fbca21cee8096fe4551","assignee":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/sleukhin/qna-sample/pulls/16/commits","review_comments_url":"https://api.github.com/repos/sleukhin/qna-sample/pulls/16/comments","review_comment_url":"https://api.github.com/repos/sleukhin/qna-sample/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sleukhin/qna-sample/issues/16/comments","statuses_url":"https://api.github.com/repos/sleukhin/qna-sample/statuses/447729b80a75d5a8e2566c1170bf3897c65e4478","head":{"label":"sleukhin:lesson-16","ref":"lesson-16","sha":"447729b80a75d5a8e2566c1170bf3897c65e4478","user":{"login":"sleukhin","id":6904800,"avatar_url":"https://avatars.githubusercontent.com/u/6904800?v=3","gravatar_id":"","url":"https://api.github.com/users/sleukhin","html_url":"https://github.com/sleukhin","followers_url":"https://api.github.com/users/sleukhin/followers","following_url":"https://api.github.com/users/sleukhin/following{/other_user}","gists_url":"https://api.github.com/users/sleukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/sleukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleukhin/subscriptions","organizations_url":"https://api.github.com/users/sleukhin/orgs","repos_url":"https://api.github.com/users/sleukhin/repos","events_url":"https://api.github.com/users/sleukhin/events{/privacy}","received_events_url":"https://api.github.com/users/sleukhin/received_events","type":"User","site_admin":false},"repo":{"id":31919865,"name":"qna-sample","full_name":"sleukhin/qna-sample","owner":{"login":"sleukhin","id":6904800,"avatar_url":"https://avatars.githubusercontent.com/u/6904800?v=3","gravatar_id":"","url":"https://api.github.com/users/sleukhin","html_url":"https://github.com/sleukhin","followers_url":"https://api.github.com/users/sleukhin/followers","following_url":"https://api.github.com/users/sleukhin/following{/other_user}","gists_url":"https://api.github.com/users/sleukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/sleukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleukhin/subscriptions","organizations_url":"https://api.github.com/users/sleukhin/orgs","repos_url":"https://api.github.com/users/sleukhin/repos","events_url":"https://api.github.com/users/sleukhin/events{/privacy}","received_events_url":"https://api.github.com/users/sleukhin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sleukhin/qna-sample","description":"","fork":false,"url":"https://api.github.com/repos/sleukhin/qna-sample","forks_url":"https://api.github.com/repos/sleukhin/qna-sample/forks","keys_url":"https://api.github.com/repos/sleukhin/qna-sample/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sleukhin/qna-sample/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sleukhin/qna-sample/teams","hooks_url":"https://api.github.com/repos/sleukhin/qna-sample/hooks","issue_events_url":"https://api.github.com/repos/sleukhin/qna-sample/issues/events{/number}","events_url":"https://api.github.com/repos/sleukhin/qna-sample/events","assignees_url":"https://api.github.com/repos/sleukhin/qna-sample/assignees{/user}","branches_url":"https://api.github.com/repos/sleukhin/qna-sample/branches{/branch}","tags_url":"https://api.github.com/repos/sleukhin/qna-sample/tags","blobs_url":"https://api.github.com/repos/sleukhin/qna-sample/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sleukhin/qna-sample/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sleukhin/qna-sample/git/refs{/sha}","trees_url":"https://api.github.com/repos/sleukhin/qna-sample/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sleukhin/qna-sample/statuses/{sha}","languages_url":"https://api.github.com/repos/sleukhin/qna-sample/languages","stargazers_url":"https://api.github.com/repos/sleukhin/qna-sample/stargazers","contributors_url":"https://api.github.com/repos/sleukhin/qna-sample/contributors","subscribers_url":"https://api.github.com/repos/sleukhin/qna-sample/subscribers","subscription_url":"https://api.github.com/repos/sleukhin/qna-sample/subscription","commits_url":"https://api.github.com/repos/sleukhin/qna-sample/commits{/sha}","git_commits_url":"https://api.github.com/repos/sleukhin/qna-sample/git/commits{/sha}","comments_url":"https://api.github.com/repos/sleukhin/qna-sample/comments{/number}","issue_comment_url":"https://api.github.com/repos/sleukhin/qna-sample/issues/comments{/number}","contents_url":"https://api.github.com/repos/sleukhin/qna-sample/contents/{+path}","compare_url":"https://api.github.com/repos/sleukhin/qna-sample/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sleukhin/qna-sample/merges","archive_url":"https://api.github.com/repos/sleukhin/qna-sample/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sleukhin/qna-sample/downloads","issues_url":"https://api.github.com/repos/sleukhin/qna-sample/issues{/number}","pulls_url":"https://api.github.com/repos/sleukhin/qna-sample/pulls{/number}","milestones_url":"https://api.github.com/repos/sleukhin/qna-sample/milestones{/number}","notifications_url":"https://api.github.com/repos/sleukhin/qna-sample/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sleukhin/qna-sample/labels{/name}","releases_url":"https://api.github.com/repos/sleukhin/qna-sample/releases{/id}","created_at":"2015-03-09T20:05:51Z","updated_at":"2015-05-06T18:16:46Z","pushed_at":"2015-05-18T09:45:59Z","git_url":"git://github.com/sleukhin/qna-sample.git","ssh_url":"git@github.com:sleukhin/qna-sample.git","clone_url":"https://github.com/sleukhin/qna-sample.git","svn_url":"https://github.com/sleukhin/qna-sample","homepage":null,"size":893,"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":"sleukhin:master","ref":"master","sha":"4739bc8d006bc98f48fa127501d1dbdd80cbe2be","user":{"login":"sleukhin","id":6904800,"avatar_url":"https://avatars.githubusercontent.com/u/6904800?v=3","gravatar_id":"","url":"https://api.github.com/users/sleukhin","html_url":"https://github.com/sleukhin","followers_url":"https://api.github.com/users/sleukhin/followers","following_url":"https://api.github.com/users/sleukhin/following{/other_user}","gists_url":"https://api.github.com/users/sleukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/sleukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleukhin/subscriptions","organizations_url":"https://api.github.com/users/sleukhin/orgs","repos_url":"https://api.github.com/users/sleukhin/repos","events_url":"https://api.github.com/users/sleukhin/events{/privacy}","received_events_url":"https://api.github.com/users/sleukhin/received_events","type":"User","site_admin":false},"repo":{"id":31919865,"name":"qna-sample","full_name":"sleukhin/qna-sample","owner":{"login":"sleukhin","id":6904800,"avatar_url":"https://avatars.githubusercontent.com/u/6904800?v=3","gravatar_id":"","url":"https://api.github.com/users/sleukhin","html_url":"https://github.com/sleukhin","followers_url":"https://api.github.com/users/sleukhin/followers","following_url":"https://api.github.com/users/sleukhin/following{/other_user}","gists_url":"https://api.github.com/users/sleukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/sleukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleukhin/subscriptions","organizations_url":"https://api.github.com/users/sleukhin/orgs","repos_url":"https://api.github.com/users/sleukhin/repos","events_url":"https://api.github.com/users/sleukhin/events{/privacy}","received_events_url":"https://api.github.com/users/sleukhin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sleukhin/qna-sample","description":"","fork":false,"url":"https://api.github.com/repos/sleukhin/qna-sample","forks_url":"https://api.github.com/repos/sleukhin/qna-sample/forks","keys_url":"https://api.github.com/repos/sleukhin/qna-sample/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sleukhin/qna-sample/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sleukhin/qna-sample/teams","hooks_url":"https://api.github.com/repos/sleukhin/qna-sample/hooks","issue_events_url":"https://api.github.com/repos/sleukhin/qna-sample/issues/events{/number}","events_url":"https://api.github.com/repos/sleukhin/qna-sample/events","assignees_url":"https://api.github.com/repos/sleukhin/qna-sample/assignees{/user}","branches_url":"https://api.github.com/repos/sleukhin/qna-sample/branches{/branch}","tags_url":"https://api.github.com/repos/sleukhin/qna-sample/tags","blobs_url":"https://api.github.com/repos/sleukhin/qna-sample/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sleukhin/qna-sample/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sleukhin/qna-sample/git/refs{/sha}","trees_url":"https://api.github.com/repos/sleukhin/qna-sample/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sleukhin/qna-sample/statuses/{sha}","languages_url":"https://api.github.com/repos/sleukhin/qna-sample/languages","stargazers_url":"https://api.github.com/repos/sleukhin/qna-sample/stargazers","contributors_url":"https://api.github.com/repos/sleukhin/qna-sample/contributors","subscribers_url":"https://api.github.com/repos/sleukhin/qna-sample/subscribers","subscription_url":"https://api.github.com/repos/sleukhin/qna-sample/subscription","commits_url":"https://api.github.com/repos/sleukhin/qna-sample/commits{/sha}","git_commits_url":"https://api.github.com/repos/sleukhin/qna-sample/git/commits{/sha}","comments_url":"https://api.github.com/repos/sleukhin/qna-sample/comments{/number}","issue_comment_url":"https://api.github.com/repos/sleukhin/qna-sample/issues/comments{/number}","contents_url":"https://api.github.com/repos/sleukhin/qna-sample/contents/{+path}","compare_url":"https://api.github.com/repos/sleukhin/qna-sample/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sleukhin/qna-sample/merges","archive_url":"https://api.github.com/repos/sleukhin/qna-sample/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sleukhin/qna-sample/downloads","issues_url":"https://api.github.com/repos/sleukhin/qna-sample/issues{/number}","pulls_url":"https://api.github.com/repos/sleukhin/qna-sample/pulls{/number}","milestones_url":"https://api.github.com/repos/sleukhin/qna-sample/milestones{/number}","notifications_url":"https://api.github.com/repos/sleukhin/qna-sample/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sleukhin/qna-sample/labels{/name}","releases_url":"https://api.github.com/repos/sleukhin/qna-sample/releases{/id}","created_at":"2015-03-09T20:05:51Z","updated_at":"2015-05-06T18:16:46Z","pushed_at":"2015-05-18T09:45:59Z","git_url":"git://github.com/sleukhin/qna-sample.git","ssh_url":"git@github.com:sleukhin/qna-sample.git","clone_url":"https://github.com/sleukhin/qna-sample.git","svn_url":"https://github.com/sleukhin/qna-sample","homepage":null,"size":893,"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/sleukhin/qna-sample/pulls/16"},"html":{"href":"https://github.com/sleukhin/qna-sample/pull/16"},"issue":{"href":"https://api.github.com/repos/sleukhin/qna-sample/issues/16"},"comments":{"href":"https://api.github.com/repos/sleukhin/qna-sample/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/sleukhin/qna-sample/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/sleukhin/qna-sample/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sleukhin/qna-sample/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/sleukhin/qna-sample/statuses/447729b80a75d5a8e2566c1170bf3897c65e4478"}}}}