{"action":"created","comment":{"url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/comments/226407420","pull_request_review_id":166222914,"id":226407420,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjQwNzQyMA==","diff_hunk":"@@ -0,0 +1,49 @@\n+class BadgeService\n+  include ApplicationHelper, OcticonsHelper # for use helper: show_badge()\n+\n+  RULES  = [:with_category, :with_level, :on_first_try]\n+\n+  def initialize(test_passage)\n+    @test = test_passage.test\n+    @user = test_passage.user\n+    users_test_passages = TestPassage.where(user_id: @user.id).select(:test_id, :correct_questions)\n+    @tests_passages = users_test_passages.map(&:test_id)\n+    @passed_tests = users_test_passages.select{|tp| tp.passed?}.map(&:test_id)\n+  end\n+\n+  def reward()","path":"app/services/badge_service.rb","position":14,"original_position":14,"commit_id":"b1f02cb149fddd4a384f912f66b98519b2770a09","original_commit_id":"b1f02cb149fddd4a384f912f66b98519b2770a09","user":{"login":"Savelov-Vitaliy","id":37415401,"node_id":"MDQ6VXNlcjM3NDE1NDAx","avatar_url":"https://avatars1.githubusercontent.com/u/37415401?v=4","gravatar_id":"","url":"https://api.github.com/users/Savelov-Vitaliy","html_url":"https://github.com/Savelov-Vitaliy","followers_url":"https://api.github.com/users/Savelov-Vitaliy/followers","following_url":"https://api.github.com/users/Savelov-Vitaliy/following{/other_user}","gists_url":"https://api.github.com/users/Savelov-Vitaliy/gists{/gist_id}","starred_url":"https://api.github.com/users/Savelov-Vitaliy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Savelov-Vitaliy/subscriptions","organizations_url":"https://api.github.com/users/Savelov-Vitaliy/orgs","repos_url":"https://api.github.com/users/Savelov-Vitaliy/repos","events_url":"https://api.github.com/users/Savelov-Vitaliy/events{/privacy}","received_events_url":"https://api.github.com/users/Savelov-Vitaliy/received_events","type":"User","site_admin":false},"body":"описка","created_at":"2018-10-18T17:59:32Z","updated_at":"2018-10-18T17:59:32Z","html_url":"https://github.com/Savelov-Vitaliy/test-guru/pull/24#discussion_r226407420","pull_request_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/24","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/comments/226407420"},"html":{"href":"https://github.com/Savelov-Vitaliy/test-guru/pull/24#discussion_r226407420"},"pull_request":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/24"}},"in_reply_to_id":226379565},"pull_request":{"url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/24","id":223933550,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzOTMzNTUw","html_url":"https://github.com/Savelov-Vitaliy/test-guru/pull/24","diff_url":"https://github.com/Savelov-Vitaliy/test-guru/pull/24.diff","patch_url":"https://github.com/Savelov-Vitaliy/test-guru/pull/24.patch","issue_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/24","number":24,"state":"open","locked":false,"title":"Badges v2.0","user":{"login":"Savelov-Vitaliy","id":37415401,"node_id":"MDQ6VXNlcjM3NDE1NDAx","avatar_url":"https://avatars1.githubusercontent.com/u/37415401?v=4","gravatar_id":"","url":"https://api.github.com/users/Savelov-Vitaliy","html_url":"https://github.com/Savelov-Vitaliy","followers_url":"https://api.github.com/users/Savelov-Vitaliy/followers","following_url":"https://api.github.com/users/Savelov-Vitaliy/following{/other_user}","gists_url":"https://api.github.com/users/Savelov-Vitaliy/gists{/gist_id}","starred_url":"https://api.github.com/users/Savelov-Vitaliy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Savelov-Vitaliy/subscriptions","organizations_url":"https://api.github.com/users/Savelov-Vitaliy/orgs","repos_url":"https://api.github.com/users/Savelov-Vitaliy/repos","events_url":"https://api.github.com/users/Savelov-Vitaliy/events{/privacy}","received_events_url":"https://api.github.com/users/Savelov-Vitaliy/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-18T12:16:24Z","updated_at":"2018-10-18T17:59:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f405f6eac5b65fa43884b74ea2a41ec307746f00","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/24/commits","review_comments_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/24/comments","review_comment_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/24/comments","statuses_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/statuses/b1f02cb149fddd4a384f912f66b98519b2770a09","head":{"label":"Savelov-Vitaliy:part_18_Badges-2","ref":"part_18_Badges-2","sha":"b1f02cb149fddd4a384f912f66b98519b2770a09","user":{"login":"Savelov-Vitaliy","id":37415401,"node_id":"MDQ6VXNlcjM3NDE1NDAx","avatar_url":"https://avatars1.githubusercontent.com/u/37415401?v=4","gravatar_id":"","url":"https://api.github.com/users/Savelov-Vitaliy","html_url":"https://github.com/Savelov-Vitaliy","followers_url":"https://api.github.com/users/Savelov-Vitaliy/followers","following_url":"https://api.github.com/users/Savelov-Vitaliy/following{/other_user}","gists_url":"https://api.github.com/users/Savelov-Vitaliy/gists{/gist_id}","starred_url":"https://api.github.com/users/Savelov-Vitaliy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Savelov-Vitaliy/subscriptions","organizations_url":"https://api.github.com/users/Savelov-Vitaliy/orgs","repos_url":"https://api.github.com/users/Savelov-Vitaliy/repos","events_url":"https://api.github.com/users/Savelov-Vitaliy/events{/privacy}","received_events_url":"https://api.github.com/users/Savelov-Vitaliy/received_events","type":"User","site_admin":false},"repo":{"id":133712756,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM3MTI3NTY=","name":"test-guru","full_name":"Savelov-Vitaliy/test-guru","private":false,"owner":{"login":"Savelov-Vitaliy","id":37415401,"node_id":"MDQ6VXNlcjM3NDE1NDAx","avatar_url":"https://avatars1.githubusercontent.com/u/37415401?v=4","gravatar_id":"","url":"https://api.github.com/users/Savelov-Vitaliy","html_url":"https://github.com/Savelov-Vitaliy","followers_url":"https://api.github.com/users/Savelov-Vitaliy/followers","following_url":"https://api.github.com/users/Savelov-Vitaliy/following{/other_user}","gists_url":"https://api.github.com/users/Savelov-Vitaliy/gists{/gist_id}","starred_url":"https://api.github.com/users/Savelov-Vitaliy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Savelov-Vitaliy/subscriptions","organizations_url":"https://api.github.com/users/Savelov-Vitaliy/orgs","repos_url":"https://api.github.com/users/Savelov-Vitaliy/repos","events_url":"https://api.github.com/users/Savelov-Vitaliy/events{/privacy}","received_events_url":"https://api.github.com/users/Savelov-Vitaliy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Savelov-Vitaliy/test-guru","description":"Rails.basics","fork":false,"url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru","forks_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/forks","keys_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/teams","hooks_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/hooks","issue_events_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/events{/number}","events_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/events","assignees_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/assignees{/user}","branches_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/branches{/branch}","tags_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/tags","blobs_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/git/refs{/sha}","trees_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/statuses/{sha}","languages_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/languages","stargazers_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/stargazers","contributors_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/contributors","subscribers_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/subscribers","subscription_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/subscription","commits_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/commits{/sha}","git_commits_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/git/commits{/sha}","comments_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/comments{/number}","issue_comment_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/comments{/number}","contents_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/contents/{+path}","compare_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/merges","archive_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/downloads","issues_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues{/number}","pulls_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls{/number}","milestones_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/milestones{/number}","notifications_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/labels{/name}","releases_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/releases{/id}","deployments_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/deployments","created_at":"2018-05-16T19:17:14Z","updated_at":"2018-10-17T09:13:36Z","pushed_at":"2018-10-18T12:16:25Z","git_url":"git://github.com/Savelov-Vitaliy/test-guru.git","ssh_url":"git@github.com:Savelov-Vitaliy/test-guru.git","clone_url":"https://github.com/Savelov-Vitaliy/test-guru.git","svn_url":"https://github.com/Savelov-Vitaliy/test-guru","homepage":null,"size":7993,"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,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Savelov-Vitaliy:master","ref":"master","sha":"6a2b988b533fc8d4a995059609dad929d686f68e","user":{"login":"Savelov-Vitaliy","id":37415401,"node_id":"MDQ6VXNlcjM3NDE1NDAx","avatar_url":"https://avatars1.githubusercontent.com/u/37415401?v=4","gravatar_id":"","url":"https://api.github.com/users/Savelov-Vitaliy","html_url":"https://github.com/Savelov-Vitaliy","followers_url":"https://api.github.com/users/Savelov-Vitaliy/followers","following_url":"https://api.github.com/users/Savelov-Vitaliy/following{/other_user}","gists_url":"https://api.github.com/users/Savelov-Vitaliy/gists{/gist_id}","starred_url":"https://api.github.com/users/Savelov-Vitaliy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Savelov-Vitaliy/subscriptions","organizations_url":"https://api.github.com/users/Savelov-Vitaliy/orgs","repos_url":"https://api.github.com/users/Savelov-Vitaliy/repos","events_url":"https://api.github.com/users/Savelov-Vitaliy/events{/privacy}","received_events_url":"https://api.github.com/users/Savelov-Vitaliy/received_events","type":"User","site_admin":false},"repo":{"id":133712756,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM3MTI3NTY=","name":"test-guru","full_name":"Savelov-Vitaliy/test-guru","private":false,"owner":{"login":"Savelov-Vitaliy","id":37415401,"node_id":"MDQ6VXNlcjM3NDE1NDAx","avatar_url":"https://avatars1.githubusercontent.com/u/37415401?v=4","gravatar_id":"","url":"https://api.github.com/users/Savelov-Vitaliy","html_url":"https://github.com/Savelov-Vitaliy","followers_url":"https://api.github.com/users/Savelov-Vitaliy/followers","following_url":"https://api.github.com/users/Savelov-Vitaliy/following{/other_user}","gists_url":"https://api.github.com/users/Savelov-Vitaliy/gists{/gist_id}","starred_url":"https://api.github.com/users/Savelov-Vitaliy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Savelov-Vitaliy/subscriptions","organizations_url":"https://api.github.com/users/Savelov-Vitaliy/orgs","repos_url":"https://api.github.com/users/Savelov-Vitaliy/repos","events_url":"https://api.github.com/users/Savelov-Vitaliy/events{/privacy}","received_events_url":"https://api.github.com/users/Savelov-Vitaliy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Savelov-Vitaliy/test-guru","description":"Rails.basics","fork":false,"url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru","forks_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/forks","keys_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/teams","hooks_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/hooks","issue_events_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/events{/number}","events_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/events","assignees_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/assignees{/user}","branches_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/branches{/branch}","tags_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/tags","blobs_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/git/refs{/sha}","trees_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/statuses/{sha}","languages_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/languages","stargazers_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/stargazers","contributors_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/contributors","subscribers_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/subscribers","subscription_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/subscription","commits_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/commits{/sha}","git_commits_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/git/commits{/sha}","comments_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/comments{/number}","issue_comment_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/comments{/number}","contents_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/contents/{+path}","compare_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/merges","archive_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/downloads","issues_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues{/number}","pulls_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls{/number}","milestones_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/milestones{/number}","notifications_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/labels{/name}","releases_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/releases{/id}","deployments_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/deployments","created_at":"2018-05-16T19:17:14Z","updated_at":"2018-10-17T09:13:36Z","pushed_at":"2018-10-18T12:16:25Z","git_url":"git://github.com/Savelov-Vitaliy/test-guru.git","ssh_url":"git@github.com:Savelov-Vitaliy/test-guru.git","clone_url":"https://github.com/Savelov-Vitaliy/test-guru.git","svn_url":"https://github.com/Savelov-Vitaliy/test-guru","homepage":null,"size":7993,"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,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/24"},"html":{"href":"https://github.com/Savelov-Vitaliy/test-guru/pull/24"},"issue":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/24"},"comments":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/statuses/b1f02cb149fddd4a384f912f66b98519b2770a09"}},"author_association":"OWNER"}}
{"actor":{"display_login":"Savelov-Vitaliy"}}