{"action":"created","comment":{"url":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/comments/57862972","id":57862972,"diff_hunk":"@@ -7,11 +7,14 @@\n       patch :unvote\n     end\n   end\n+  concern :commentable do\n+    resources :comments, only: [:create]\n+  end\n   devise_for :users\n   # The priority is based upon order of creation: first created -> highest priority.\n   # See how all your routes lay out with \"rake routes\".\n-  resources :questions, concerns: :votable do\n-    resources :answers, only: [:create, :destroy, :update], concerns: :votable do\n+  resources :questions, concerns: [:votable, :commentable] do\n+    resources :answers, only: [:create, :destroy, :update], concerns: [:votable, :commentable] do","path":"config/routes.rb","position":13,"original_position":13,"commit_id":"e7c2a208a5de6acf57f23fd1d036089cd05c70b3","original_commit_id":"e7c2a208a5de6acf57f23fd1d036089cd05c70b3","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":"У тебя получается тройная вложенность, а это очень плохое решение, т.к. усложняет код там, где можно без этого обойтись. Давно пора переделать и answers и комментарии на shallow. Укажи у родительского ресурса questions опцию shallow: true, тогда у тебя все вложенные тоже станут shallow.  Почитай [здесь](http://guides.rubyonrails.org/routing.html#nested-resources) об этом (раздел 2.7.2).\r\n\r\nP.S. Да, после этого полетят все тесты и все виды почти надо будет переделать, чтобы ссылки были правильные. Но что поделать, хороший код, как и красота, требуют жертв.\r\n","created_at":"2016-03-30T09:52:48Z","updated_at":"2016-03-30T09:52:48Z","html_url":"https://github.com/hardlin3r/heapoverflow/pull/8#discussion_r57862972","pull_request_url":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/comments/57862972"},"html":{"href":"https://github.com/hardlin3r/heapoverflow/pull/8#discussion_r57862972"},"pull_request":{"href":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/8","id":64514877,"html_url":"https://github.com/hardlin3r/heapoverflow/pull/8","diff_url":"https://github.com/hardlin3r/heapoverflow/pull/8.diff","patch_url":"https://github.com/hardlin3r/heapoverflow/pull/8.patch","issue_url":"https://api.github.com/repos/hardlin3r/heapoverflow/issues/8","number":8,"state":"open","locked":false,"title":"Pub sub","user":{"login":"hardlin3r","id":3716701,"avatar_url":"https://avatars.githubusercontent.com/u/3716701?v=3","gravatar_id":"","url":"https://api.github.com/users/hardlin3r","html_url":"https://github.com/hardlin3r","followers_url":"https://api.github.com/users/hardlin3r/followers","following_url":"https://api.github.com/users/hardlin3r/following{/other_user}","gists_url":"https://api.github.com/users/hardlin3r/gists{/gist_id}","starred_url":"https://api.github.com/users/hardlin3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardlin3r/subscriptions","organizations_url":"https://api.github.com/users/hardlin3r/orgs","repos_url":"https://api.github.com/users/hardlin3r/repos","events_url":"https://api.github.com/users/hardlin3r/events{/privacy}","received_events_url":"https://api.github.com/users/hardlin3r/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-29T18:53:03Z","updated_at":"2016-03-30T09:52:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"035bb837a57a14d4bda7c7cada637620ea16d6c6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/8/commits","review_comments_url":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/8/comments","review_comment_url":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hardlin3r/heapoverflow/issues/8/comments","statuses_url":"https://api.github.com/repos/hardlin3r/heapoverflow/statuses/e7c2a208a5de6acf57f23fd1d036089cd05c70b3","head":{"label":"hardlin3r:pub_sub","ref":"pub_sub","sha":"e7c2a208a5de6acf57f23fd1d036089cd05c70b3","user":{"login":"hardlin3r","id":3716701,"avatar_url":"https://avatars.githubusercontent.com/u/3716701?v=3","gravatar_id":"","url":"https://api.github.com/users/hardlin3r","html_url":"https://github.com/hardlin3r","followers_url":"https://api.github.com/users/hardlin3r/followers","following_url":"https://api.github.com/users/hardlin3r/following{/other_user}","gists_url":"https://api.github.com/users/hardlin3r/gists{/gist_id}","starred_url":"https://api.github.com/users/hardlin3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardlin3r/subscriptions","organizations_url":"https://api.github.com/users/hardlin3r/orgs","repos_url":"https://api.github.com/users/hardlin3r/repos","events_url":"https://api.github.com/users/hardlin3r/events{/privacy}","received_events_url":"https://api.github.com/users/hardlin3r/received_events","type":"User","site_admin":false},"repo":{"id":49836970,"name":"heapoverflow","full_name":"hardlin3r/heapoverflow","owner":{"login":"hardlin3r","id":3716701,"avatar_url":"https://avatars.githubusercontent.com/u/3716701?v=3","gravatar_id":"","url":"https://api.github.com/users/hardlin3r","html_url":"https://github.com/hardlin3r","followers_url":"https://api.github.com/users/hardlin3r/followers","following_url":"https://api.github.com/users/hardlin3r/following{/other_user}","gists_url":"https://api.github.com/users/hardlin3r/gists{/gist_id}","starred_url":"https://api.github.com/users/hardlin3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardlin3r/subscriptions","organizations_url":"https://api.github.com/users/hardlin3r/orgs","repos_url":"https://api.github.com/users/hardlin3r/repos","events_url":"https://api.github.com/users/hardlin3r/events{/privacy}","received_events_url":"https://api.github.com/users/hardlin3r/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hardlin3r/heapoverflow","description":"","fork":false,"url":"https://api.github.com/repos/hardlin3r/heapoverflow","forks_url":"https://api.github.com/repos/hardlin3r/heapoverflow/forks","keys_url":"https://api.github.com/repos/hardlin3r/heapoverflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hardlin3r/heapoverflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hardlin3r/heapoverflow/teams","hooks_url":"https://api.github.com/repos/hardlin3r/heapoverflow/hooks","issue_events_url":"https://api.github.com/repos/hardlin3r/heapoverflow/issues/events{/number}","events_url":"https://api.github.com/repos/hardlin3r/heapoverflow/events","assignees_url":"https://api.github.com/repos/hardlin3r/heapoverflow/assignees{/user}","branches_url":"https://api.github.com/repos/hardlin3r/heapoverflow/branches{/branch}","tags_url":"https://api.github.com/repos/hardlin3r/heapoverflow/tags","blobs_url":"https://api.github.com/repos/hardlin3r/heapoverflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hardlin3r/heapoverflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hardlin3r/heapoverflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/hardlin3r/heapoverflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hardlin3r/heapoverflow/statuses/{sha}","languages_url":"https://api.github.com/repos/hardlin3r/heapoverflow/languages","stargazers_url":"https://api.github.com/repos/hardlin3r/heapoverflow/stargazers","contributors_url":"https://api.github.com/repos/hardlin3r/heapoverflow/contributors","subscribers_url":"https://api.github.com/repos/hardlin3r/heapoverflow/subscribers","subscription_url":"https://api.github.com/repos/hardlin3r/heapoverflow/subscription","commits_url":"https://api.github.com/repos/hardlin3r/heapoverflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/hardlin3r/heapoverflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/hardlin3r/heapoverflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/hardlin3r/heapoverflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/hardlin3r/heapoverflow/contents/{+path}","compare_url":"https://api.github.com/repos/hardlin3r/heapoverflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hardlin3r/heapoverflow/merges","archive_url":"https://api.github.com/repos/hardlin3r/heapoverflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hardlin3r/heapoverflow/downloads","issues_url":"https://api.github.com/repos/hardlin3r/heapoverflow/issues{/number}","pulls_url":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls{/number}","milestones_url":"https://api.github.com/repos/hardlin3r/heapoverflow/milestones{/number}","notifications_url":"https://api.github.com/repos/hardlin3r/heapoverflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hardlin3r/heapoverflow/labels{/name}","releases_url":"https://api.github.com/repos/hardlin3r/heapoverflow/releases{/id}","deployments_url":"https://api.github.com/repos/hardlin3r/heapoverflow/deployments","created_at":"2016-01-17T21:42:23Z","updated_at":"2016-03-18T23:24:47Z","pushed_at":"2016-03-29T18:53:04Z","git_url":"git://github.com/hardlin3r/heapoverflow.git","ssh_url":"git@github.com:hardlin3r/heapoverflow.git","clone_url":"https://github.com/hardlin3r/heapoverflow.git","svn_url":"https://github.com/hardlin3r/heapoverflow","homepage":null,"size":212,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"hardlin3r:master","ref":"master","sha":"529a59b3e21bfd93acf52ee24bbcff9292bd8457","user":{"login":"hardlin3r","id":3716701,"avatar_url":"https://avatars.githubusercontent.com/u/3716701?v=3","gravatar_id":"","url":"https://api.github.com/users/hardlin3r","html_url":"https://github.com/hardlin3r","followers_url":"https://api.github.com/users/hardlin3r/followers","following_url":"https://api.github.com/users/hardlin3r/following{/other_user}","gists_url":"https://api.github.com/users/hardlin3r/gists{/gist_id}","starred_url":"https://api.github.com/users/hardlin3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardlin3r/subscriptions","organizations_url":"https://api.github.com/users/hardlin3r/orgs","repos_url":"https://api.github.com/users/hardlin3r/repos","events_url":"https://api.github.com/users/hardlin3r/events{/privacy}","received_events_url":"https://api.github.com/users/hardlin3r/received_events","type":"User","site_admin":false},"repo":{"id":49836970,"name":"heapoverflow","full_name":"hardlin3r/heapoverflow","owner":{"login":"hardlin3r","id":3716701,"avatar_url":"https://avatars.githubusercontent.com/u/3716701?v=3","gravatar_id":"","url":"https://api.github.com/users/hardlin3r","html_url":"https://github.com/hardlin3r","followers_url":"https://api.github.com/users/hardlin3r/followers","following_url":"https://api.github.com/users/hardlin3r/following{/other_user}","gists_url":"https://api.github.com/users/hardlin3r/gists{/gist_id}","starred_url":"https://api.github.com/users/hardlin3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardlin3r/subscriptions","organizations_url":"https://api.github.com/users/hardlin3r/orgs","repos_url":"https://api.github.com/users/hardlin3r/repos","events_url":"https://api.github.com/users/hardlin3r/events{/privacy}","received_events_url":"https://api.github.com/users/hardlin3r/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hardlin3r/heapoverflow","description":"","fork":false,"url":"https://api.github.com/repos/hardlin3r/heapoverflow","forks_url":"https://api.github.com/repos/hardlin3r/heapoverflow/forks","keys_url":"https://api.github.com/repos/hardlin3r/heapoverflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hardlin3r/heapoverflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hardlin3r/heapoverflow/teams","hooks_url":"https://api.github.com/repos/hardlin3r/heapoverflow/hooks","issue_events_url":"https://api.github.com/repos/hardlin3r/heapoverflow/issues/events{/number}","events_url":"https://api.github.com/repos/hardlin3r/heapoverflow/events","assignees_url":"https://api.github.com/repos/hardlin3r/heapoverflow/assignees{/user}","branches_url":"https://api.github.com/repos/hardlin3r/heapoverflow/branches{/branch}","tags_url":"https://api.github.com/repos/hardlin3r/heapoverflow/tags","blobs_url":"https://api.github.com/repos/hardlin3r/heapoverflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hardlin3r/heapoverflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hardlin3r/heapoverflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/hardlin3r/heapoverflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hardlin3r/heapoverflow/statuses/{sha}","languages_url":"https://api.github.com/repos/hardlin3r/heapoverflow/languages","stargazers_url":"https://api.github.com/repos/hardlin3r/heapoverflow/stargazers","contributors_url":"https://api.github.com/repos/hardlin3r/heapoverflow/contributors","subscribers_url":"https://api.github.com/repos/hardlin3r/heapoverflow/subscribers","subscription_url":"https://api.github.com/repos/hardlin3r/heapoverflow/subscription","commits_url":"https://api.github.com/repos/hardlin3r/heapoverflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/hardlin3r/heapoverflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/hardlin3r/heapoverflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/hardlin3r/heapoverflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/hardlin3r/heapoverflow/contents/{+path}","compare_url":"https://api.github.com/repos/hardlin3r/heapoverflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hardlin3r/heapoverflow/merges","archive_url":"https://api.github.com/repos/hardlin3r/heapoverflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hardlin3r/heapoverflow/downloads","issues_url":"https://api.github.com/repos/hardlin3r/heapoverflow/issues{/number}","pulls_url":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls{/number}","milestones_url":"https://api.github.com/repos/hardlin3r/heapoverflow/milestones{/number}","notifications_url":"https://api.github.com/repos/hardlin3r/heapoverflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hardlin3r/heapoverflow/labels{/name}","releases_url":"https://api.github.com/repos/hardlin3r/heapoverflow/releases{/id}","deployments_url":"https://api.github.com/repos/hardlin3r/heapoverflow/deployments","created_at":"2016-01-17T21:42:23Z","updated_at":"2016-03-18T23:24:47Z","pushed_at":"2016-03-29T18:53:04Z","git_url":"git://github.com/hardlin3r/heapoverflow.git","ssh_url":"git@github.com:hardlin3r/heapoverflow.git","clone_url":"https://github.com/hardlin3r/heapoverflow.git","svn_url":"https://github.com/hardlin3r/heapoverflow","homepage":null,"size":212,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/8"},"html":{"href":"https://github.com/hardlin3r/heapoverflow/pull/8"},"issue":{"href":"https://api.github.com/repos/hardlin3r/heapoverflow/issues/8"},"comments":{"href":"https://api.github.com/repos/hardlin3r/heapoverflow/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hardlin3r/heapoverflow/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/hardlin3r/heapoverflow/statuses/e7c2a208a5de6acf57f23fd1d036089cd05c70b3"}}}}