{"action":"created","comment":{"url":"https://api.github.com/repos/nazip/hope/pulls/comments/40078351","id":40078351,"diff_hunk":"@@ -0,0 +1,8 @@\n+class SearchController < ApplicationController\n+  def index\n+    if ['question', 'answer', 'user', 'comment', 'thinking_sphinx'].include?(params[:search]) and params.key?('query')\n+      @search =  Kernel.const_get(params[:search].classify).search params[:query], :page => params[:page], :per_page => 3","path":"app/controllers/search_controller.rb","position":4,"original_position":4,"commit_id":"d0f51ae06abccf03f9bf0bf1f4ed8efa7be0b8b4","original_commit_id":"d0f51ae06abccf03f9bf0bf1f4ed8efa7be0b8b4","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":"Зачем через const_get. Можно ThinkningSphinx в метод search передать параметр classes и искать только по нужным классам. ","created_at":"2015-09-22T12:11:28Z","updated_at":"2015-09-22T12:11:28Z","html_url":"https://github.com/nazip/hope/pull/16#discussion_r40078351","pull_request_url":"https://api.github.com/repos/nazip/hope/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/nazip/hope/pulls/comments/40078351"},"html":{"href":"https://github.com/nazip/hope/pull/16#discussion_r40078351"},"pull_request":{"href":"https://api.github.com/repos/nazip/hope/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/nazip/hope/pulls/16","id":45629737,"html_url":"https://github.com/nazip/hope/pull/16","diff_url":"https://github.com/nazip/hope/pull/16.diff","patch_url":"https://github.com/nazip/hope/pull/16.patch","issue_url":"https://api.github.com/repos/nazip/hope/issues/16","number":16,"state":"open","locked":false,"title":"Lesson 18","user":{"login":"nazip","id":3962833,"avatar_url":"https://avatars.githubusercontent.com/u/3962833?v=3","gravatar_id":"","url":"https://api.github.com/users/nazip","html_url":"https://github.com/nazip","followers_url":"https://api.github.com/users/nazip/followers","following_url":"https://api.github.com/users/nazip/following{/other_user}","gists_url":"https://api.github.com/users/nazip/gists{/gist_id}","starred_url":"https://api.github.com/users/nazip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nazip/subscriptions","organizations_url":"https://api.github.com/users/nazip/orgs","repos_url":"https://api.github.com/users/nazip/repos","events_url":"https://api.github.com/users/nazip/events{/privacy}","received_events_url":"https://api.github.com/users/nazip/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-22T06:14:02Z","updated_at":"2015-09-22T12:11:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb1b643367a9b517f3d7c9c03e3fc91453a00f1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nazip/hope/pulls/16/commits","review_comments_url":"https://api.github.com/repos/nazip/hope/pulls/16/comments","review_comment_url":"https://api.github.com/repos/nazip/hope/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nazip/hope/issues/16/comments","statuses_url":"https://api.github.com/repos/nazip/hope/statuses/d0f51ae06abccf03f9bf0bf1f4ed8efa7be0b8b4","head":{"label":"nazip:lesson-18","ref":"lesson-18","sha":"d0f51ae06abccf03f9bf0bf1f4ed8efa7be0b8b4","user":{"login":"nazip","id":3962833,"avatar_url":"https://avatars.githubusercontent.com/u/3962833?v=3","gravatar_id":"","url":"https://api.github.com/users/nazip","html_url":"https://github.com/nazip","followers_url":"https://api.github.com/users/nazip/followers","following_url":"https://api.github.com/users/nazip/following{/other_user}","gists_url":"https://api.github.com/users/nazip/gists{/gist_id}","starred_url":"https://api.github.com/users/nazip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nazip/subscriptions","organizations_url":"https://api.github.com/users/nazip/orgs","repos_url":"https://api.github.com/users/nazip/repos","events_url":"https://api.github.com/users/nazip/events{/privacy}","received_events_url":"https://api.github.com/users/nazip/received_events","type":"User","site_admin":false},"repo":{"id":36570759,"name":"hope","full_name":"nazip/hope","owner":{"login":"nazip","id":3962833,"avatar_url":"https://avatars.githubusercontent.com/u/3962833?v=3","gravatar_id":"","url":"https://api.github.com/users/nazip","html_url":"https://github.com/nazip","followers_url":"https://api.github.com/users/nazip/followers","following_url":"https://api.github.com/users/nazip/following{/other_user}","gists_url":"https://api.github.com/users/nazip/gists{/gist_id}","starred_url":"https://api.github.com/users/nazip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nazip/subscriptions","organizations_url":"https://api.github.com/users/nazip/orgs","repos_url":"https://api.github.com/users/nazip/repos","events_url":"https://api.github.com/users/nazip/events{/privacy}","received_events_url":"https://api.github.com/users/nazip/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nazip/hope","description":"курс thinknetica","fork":false,"url":"https://api.github.com/repos/nazip/hope","forks_url":"https://api.github.com/repos/nazip/hope/forks","keys_url":"https://api.github.com/repos/nazip/hope/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nazip/hope/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nazip/hope/teams","hooks_url":"https://api.github.com/repos/nazip/hope/hooks","issue_events_url":"https://api.github.com/repos/nazip/hope/issues/events{/number}","events_url":"https://api.github.com/repos/nazip/hope/events","assignees_url":"https://api.github.com/repos/nazip/hope/assignees{/user}","branches_url":"https://api.github.com/repos/nazip/hope/branches{/branch}","tags_url":"https://api.github.com/repos/nazip/hope/tags","blobs_url":"https://api.github.com/repos/nazip/hope/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nazip/hope/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nazip/hope/git/refs{/sha}","trees_url":"https://api.github.com/repos/nazip/hope/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nazip/hope/statuses/{sha}","languages_url":"https://api.github.com/repos/nazip/hope/languages","stargazers_url":"https://api.github.com/repos/nazip/hope/stargazers","contributors_url":"https://api.github.com/repos/nazip/hope/contributors","subscribers_url":"https://api.github.com/repos/nazip/hope/subscribers","subscription_url":"https://api.github.com/repos/nazip/hope/subscription","commits_url":"https://api.github.com/repos/nazip/hope/commits{/sha}","git_commits_url":"https://api.github.com/repos/nazip/hope/git/commits{/sha}","comments_url":"https://api.github.com/repos/nazip/hope/comments{/number}","issue_comment_url":"https://api.github.com/repos/nazip/hope/issues/comments{/number}","contents_url":"https://api.github.com/repos/nazip/hope/contents/{+path}","compare_url":"https://api.github.com/repos/nazip/hope/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nazip/hope/merges","archive_url":"https://api.github.com/repos/nazip/hope/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nazip/hope/downloads","issues_url":"https://api.github.com/repos/nazip/hope/issues{/number}","pulls_url":"https://api.github.com/repos/nazip/hope/pulls{/number}","milestones_url":"https://api.github.com/repos/nazip/hope/milestones{/number}","notifications_url":"https://api.github.com/repos/nazip/hope/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nazip/hope/labels{/name}","releases_url":"https://api.github.com/repos/nazip/hope/releases{/id}","created_at":"2015-05-30T18:39:32Z","updated_at":"2015-05-31T14:50:36Z","pushed_at":"2015-09-22T06:14:02Z","git_url":"git://github.com/nazip/hope.git","ssh_url":"git@github.com:nazip/hope.git","clone_url":"https://github.com/nazip/hope.git","svn_url":"https://github.com/nazip/hope","homepage":null,"size":4124,"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":"nazip:master","ref":"master","sha":"3ee20584c4e35a493b8f3cb9efecf6494325df7c","user":{"login":"nazip","id":3962833,"avatar_url":"https://avatars.githubusercontent.com/u/3962833?v=3","gravatar_id":"","url":"https://api.github.com/users/nazip","html_url":"https://github.com/nazip","followers_url":"https://api.github.com/users/nazip/followers","following_url":"https://api.github.com/users/nazip/following{/other_user}","gists_url":"https://api.github.com/users/nazip/gists{/gist_id}","starred_url":"https://api.github.com/users/nazip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nazip/subscriptions","organizations_url":"https://api.github.com/users/nazip/orgs","repos_url":"https://api.github.com/users/nazip/repos","events_url":"https://api.github.com/users/nazip/events{/privacy}","received_events_url":"https://api.github.com/users/nazip/received_events","type":"User","site_admin":false},"repo":{"id":36570759,"name":"hope","full_name":"nazip/hope","owner":{"login":"nazip","id":3962833,"avatar_url":"https://avatars.githubusercontent.com/u/3962833?v=3","gravatar_id":"","url":"https://api.github.com/users/nazip","html_url":"https://github.com/nazip","followers_url":"https://api.github.com/users/nazip/followers","following_url":"https://api.github.com/users/nazip/following{/other_user}","gists_url":"https://api.github.com/users/nazip/gists{/gist_id}","starred_url":"https://api.github.com/users/nazip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nazip/subscriptions","organizations_url":"https://api.github.com/users/nazip/orgs","repos_url":"https://api.github.com/users/nazip/repos","events_url":"https://api.github.com/users/nazip/events{/privacy}","received_events_url":"https://api.github.com/users/nazip/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nazip/hope","description":"курс thinknetica","fork":false,"url":"https://api.github.com/repos/nazip/hope","forks_url":"https://api.github.com/repos/nazip/hope/forks","keys_url":"https://api.github.com/repos/nazip/hope/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nazip/hope/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nazip/hope/teams","hooks_url":"https://api.github.com/repos/nazip/hope/hooks","issue_events_url":"https://api.github.com/repos/nazip/hope/issues/events{/number}","events_url":"https://api.github.com/repos/nazip/hope/events","assignees_url":"https://api.github.com/repos/nazip/hope/assignees{/user}","branches_url":"https://api.github.com/repos/nazip/hope/branches{/branch}","tags_url":"https://api.github.com/repos/nazip/hope/tags","blobs_url":"https://api.github.com/repos/nazip/hope/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nazip/hope/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nazip/hope/git/refs{/sha}","trees_url":"https://api.github.com/repos/nazip/hope/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nazip/hope/statuses/{sha}","languages_url":"https://api.github.com/repos/nazip/hope/languages","stargazers_url":"https://api.github.com/repos/nazip/hope/stargazers","contributors_url":"https://api.github.com/repos/nazip/hope/contributors","subscribers_url":"https://api.github.com/repos/nazip/hope/subscribers","subscription_url":"https://api.github.com/repos/nazip/hope/subscription","commits_url":"https://api.github.com/repos/nazip/hope/commits{/sha}","git_commits_url":"https://api.github.com/repos/nazip/hope/git/commits{/sha}","comments_url":"https://api.github.com/repos/nazip/hope/comments{/number}","issue_comment_url":"https://api.github.com/repos/nazip/hope/issues/comments{/number}","contents_url":"https://api.github.com/repos/nazip/hope/contents/{+path}","compare_url":"https://api.github.com/repos/nazip/hope/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nazip/hope/merges","archive_url":"https://api.github.com/repos/nazip/hope/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nazip/hope/downloads","issues_url":"https://api.github.com/repos/nazip/hope/issues{/number}","pulls_url":"https://api.github.com/repos/nazip/hope/pulls{/number}","milestones_url":"https://api.github.com/repos/nazip/hope/milestones{/number}","notifications_url":"https://api.github.com/repos/nazip/hope/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nazip/hope/labels{/name}","releases_url":"https://api.github.com/repos/nazip/hope/releases{/id}","created_at":"2015-05-30T18:39:32Z","updated_at":"2015-05-31T14:50:36Z","pushed_at":"2015-09-22T06:14:02Z","git_url":"git://github.com/nazip/hope.git","ssh_url":"git@github.com:nazip/hope.git","clone_url":"https://github.com/nazip/hope.git","svn_url":"https://github.com/nazip/hope","homepage":null,"size":4124,"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/nazip/hope/pulls/16"},"html":{"href":"https://github.com/nazip/hope/pull/16"},"issue":{"href":"https://api.github.com/repos/nazip/hope/issues/16"},"comments":{"href":"https://api.github.com/repos/nazip/hope/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/nazip/hope/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/nazip/hope/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nazip/hope/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/nazip/hope/statuses/d0f51ae06abccf03f9bf0bf1f4ed8efa7be0b8b4"}}}}