{"action":"created","comment":{"url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/comments/224584292","pull_request_review_id":163989187,"id":224584292,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDU4NDI5Mg==","diff_hunk":"@@ -6,6 +6,10 @@ def show\n   end\n \n   def result\n+    test = @test_passage.test\n+    tests_passages = TestPassage.where(user_id: @test_passage.user.id).map {|tp| tp}","path":"app/controllers/test_passages_controller.rb","position":5,"original_position":5,"commit_id":"d6610ec698e7f6d4db76efcf784a1c3d20798149","original_commit_id":"d6610ec698e7f6d4db76efcf784a1c3d20798149","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":"Кажется что да, но без этого \".map {|tp| tp}\"  \r\nRails ругается на tests_passages.count(@test) и появляется вот эта ошибка:\r\n\r\nActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near \":\"\r\nLINE 1: SELECT COUNT(#Test:0x0bb9d8e4) FROM \"test_passages\" WHERE ...\r\n^\r\n: SELECT COUNT(#Test:0x0bb9d8e4) FROM \"test_passages\" WHERE \"test_passages\".\"user_id\" = $1):\r\n","created_at":"2018-10-11T19:57:32Z","updated_at":"2018-10-11T19:57:32Z","html_url":"https://github.com/Savelov-Vitaliy/test-guru/pull/22#discussion_r224584292","pull_request_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/22","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/comments/224584292"},"html":{"href":"https://github.com/Savelov-Vitaliy/test-guru/pull/22#discussion_r224584292"},"pull_request":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/22"}},"in_reply_to_id":224519017},"pull_request":{"url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/22","id":222137192,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyMTM3MTky","html_url":"https://github.com/Savelov-Vitaliy/test-guru/pull/22","diff_url":"https://github.com/Savelov-Vitaliy/test-guru/pull/22.diff","patch_url":"https://github.com/Savelov-Vitaliy/test-guru/pull/22.patch","issue_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/22","number":22,"state":"open","locked":false,"title":"Badges v1.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-11T13:25:43Z","updated_at":"2018-10-11T19:57:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d9255d19fbf02d694e19f7daf09139f56d108eb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/22/commits","review_comments_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/22/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/22/comments","statuses_url":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/statuses/d6610ec698e7f6d4db76efcf784a1c3d20798149","head":{"label":"Savelov-Vitaliy:part_18_Badges","ref":"part_18_Badges","sha":"d6610ec698e7f6d4db76efcf784a1c3d20798149","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-02T12:36:54Z","pushed_at":"2018-10-11T13:25:44Z","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":7966,"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":"54823b0e6705b54f95726e87e7f080b624fdf100","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-02T12:36:54Z","pushed_at":"2018-10-11T13:25:44Z","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":7966,"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/22"},"html":{"href":"https://github.com/Savelov-Vitaliy/test-guru/pull/22"},"issue":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/22"},"comments":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/pulls/22/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/22/commits"},"statuses":{"href":"https://api.github.com/repos/Savelov-Vitaliy/test-guru/statuses/d6610ec698e7f6d4db76efcf784a1c3d20798149"}},"author_association":"OWNER"}}
{"actor":{"display_login":"Savelov-Vitaliy"}}