{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_191/pulls/comments/82709815","pull_request_review_id":3598247,"id":82709815,"diff_hunk":"@@ -7,4 +7,14 @@ class Result < ApplicationRecord\n   scope :correct_anwsers, -> do\n     joins(:answer).where(\"answers.is_correct = ?\", true)\n   end\n+  class << self\n+    def search search\n+      if search\n+        joins(\"INNER JOIN lessons ON results.lesson_id = lessons.id\")","path":"app/models/result.rb","position":7,"original_position":7,"commit_id":"17983484c81191a0c4b6cfe66211373a68089d29","original_commit_id":"585729325ebc0c7c701a53c6a03821fd5e7ff233","user":{"login":"nvtanh","id":5591946,"avatar_url":"https://avatars.githubusercontent.com/u/5591946?v=3","gravatar_id":"","url":"https://api.github.com/users/nvtanh","html_url":"https://github.com/nvtanh","followers_url":"https://api.github.com/users/nvtanh/followers","following_url":"https://api.github.com/users/nvtanh/following{/other_user}","gists_url":"https://api.github.com/users/nvtanh/gists{/gist_id}","starred_url":"https://api.github.com/users/nvtanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvtanh/subscriptions","organizations_url":"https://api.github.com/users/nvtanh/orgs","repos_url":"https://api.github.com/users/nvtanh/repos","events_url":"https://api.github.com/users/nvtanh/events{/privacy}","received_events_url":"https://api.github.com/users/nvtanh/received_events","type":"User","site_admin":false},"body":"tách cái này ra 1 scope mới: \r\n`joins(\"INNER JOIN lessons ON results.lesson_id = lessons.id\").where \"lessons.category_id = ?\", search` \r\nvà đặt tên thể hiện đúng cái nó làm","created_at":"2016-10-11T01:07:09Z","updated_at":"2016-10-11T01:07:18Z","html_url":"https://github.com/framgia/fels_191/pull/17#discussion_r82709815","pull_request_url":"https://api.github.com/repos/framgia/fels_191/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_191/pulls/comments/82709815"},"html":{"href":"https://github.com/framgia/fels_191/pull/17#discussion_r82709815"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_191/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_191/pulls/17","id":88631900,"html_url":"https://github.com/framgia/fels_191/pull/17","diff_url":"https://github.com/framgia/fels_191/pull/17.diff","patch_url":"https://github.com/framgia/fels_191/pull/17.patch","issue_url":"https://api.github.com/repos/framgia/fels_191/issues/17","number":17,"state":"open","locked":false,"title":"Filter word by category","user":{"login":"cuclt","id":22047749,"avatar_url":"https://avatars.githubusercontent.com/u/22047749?v=3","gravatar_id":"","url":"https://api.github.com/users/cuclt","html_url":"https://github.com/cuclt","followers_url":"https://api.github.com/users/cuclt/followers","following_url":"https://api.github.com/users/cuclt/following{/other_user}","gists_url":"https://api.github.com/users/cuclt/gists{/gist_id}","starred_url":"https://api.github.com/users/cuclt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuclt/subscriptions","organizations_url":"https://api.github.com/users/cuclt/orgs","repos_url":"https://api.github.com/users/cuclt/repos","events_url":"https://api.github.com/users/cuclt/events{/privacy}","received_events_url":"https://api.github.com/users/cuclt/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-10T09:23:49Z","updated_at":"2016-10-11T01:07:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6443492d56a5c7f4b7150b1f7d2b438c4fae916","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_191/pulls/17/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_191/pulls/17/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_191/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fels_191/issues/17/comments","statuses_url":"https://api.github.com/repos/framgia/fels_191/statuses/17983484c81191a0c4b6cfe66211373a68089d29","head":{"label":"cuclt:filter-word-by-category","ref":"filter-word-by-category","sha":"17983484c81191a0c4b6cfe66211373a68089d29","user":{"login":"cuclt","id":22047749,"avatar_url":"https://avatars.githubusercontent.com/u/22047749?v=3","gravatar_id":"","url":"https://api.github.com/users/cuclt","html_url":"https://github.com/cuclt","followers_url":"https://api.github.com/users/cuclt/followers","following_url":"https://api.github.com/users/cuclt/following{/other_user}","gists_url":"https://api.github.com/users/cuclt/gists{/gist_id}","starred_url":"https://api.github.com/users/cuclt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuclt/subscriptions","organizations_url":"https://api.github.com/users/cuclt/orgs","repos_url":"https://api.github.com/users/cuclt/repos","events_url":"https://api.github.com/users/cuclt/events{/privacy}","received_events_url":"https://api.github.com/users/cuclt/received_events","type":"User","site_admin":false},"repo":{"id":69451225,"name":"fels_191","full_name":"cuclt/fels_191","owner":{"login":"cuclt","id":22047749,"avatar_url":"https://avatars.githubusercontent.com/u/22047749?v=3","gravatar_id":"","url":"https://api.github.com/users/cuclt","html_url":"https://github.com/cuclt","followers_url":"https://api.github.com/users/cuclt/followers","following_url":"https://api.github.com/users/cuclt/following{/other_user}","gists_url":"https://api.github.com/users/cuclt/gists{/gist_id}","starred_url":"https://api.github.com/users/cuclt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuclt/subscriptions","organizations_url":"https://api.github.com/users/cuclt/orgs","repos_url":"https://api.github.com/users/cuclt/repos","events_url":"https://api.github.com/users/cuclt/events{/privacy}","received_events_url":"https://api.github.com/users/cuclt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cuclt/fels_191","description":"Framgia E Learning System (Training)","fork":true,"url":"https://api.github.com/repos/cuclt/fels_191","forks_url":"https://api.github.com/repos/cuclt/fels_191/forks","keys_url":"https://api.github.com/repos/cuclt/fels_191/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cuclt/fels_191/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cuclt/fels_191/teams","hooks_url":"https://api.github.com/repos/cuclt/fels_191/hooks","issue_events_url":"https://api.github.com/repos/cuclt/fels_191/issues/events{/number}","events_url":"https://api.github.com/repos/cuclt/fels_191/events","assignees_url":"https://api.github.com/repos/cuclt/fels_191/assignees{/user}","branches_url":"https://api.github.com/repos/cuclt/fels_191/branches{/branch}","tags_url":"https://api.github.com/repos/cuclt/fels_191/tags","blobs_url":"https://api.github.com/repos/cuclt/fels_191/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cuclt/fels_191/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cuclt/fels_191/git/refs{/sha}","trees_url":"https://api.github.com/repos/cuclt/fels_191/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cuclt/fels_191/statuses/{sha}","languages_url":"https://api.github.com/repos/cuclt/fels_191/languages","stargazers_url":"https://api.github.com/repos/cuclt/fels_191/stargazers","contributors_url":"https://api.github.com/repos/cuclt/fels_191/contributors","subscribers_url":"https://api.github.com/repos/cuclt/fels_191/subscribers","subscription_url":"https://api.github.com/repos/cuclt/fels_191/subscription","commits_url":"https://api.github.com/repos/cuclt/fels_191/commits{/sha}","git_commits_url":"https://api.github.com/repos/cuclt/fels_191/git/commits{/sha}","comments_url":"https://api.github.com/repos/cuclt/fels_191/comments{/number}","issue_comment_url":"https://api.github.com/repos/cuclt/fels_191/issues/comments{/number}","contents_url":"https://api.github.com/repos/cuclt/fels_191/contents/{+path}","compare_url":"https://api.github.com/repos/cuclt/fels_191/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cuclt/fels_191/merges","archive_url":"https://api.github.com/repos/cuclt/fels_191/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cuclt/fels_191/downloads","issues_url":"https://api.github.com/repos/cuclt/fels_191/issues{/number}","pulls_url":"https://api.github.com/repos/cuclt/fels_191/pulls{/number}","milestones_url":"https://api.github.com/repos/cuclt/fels_191/milestones{/number}","notifications_url":"https://api.github.com/repos/cuclt/fels_191/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cuclt/fels_191/labels{/name}","releases_url":"https://api.github.com/repos/cuclt/fels_191/releases{/id}","deployments_url":"https://api.github.com/repos/cuclt/fels_191/deployments","created_at":"2016-09-28T10:08:43Z","updated_at":"2016-09-28T10:08:44Z","pushed_at":"2016-10-10T16:33:23Z","git_url":"git://github.com/cuclt/fels_191.git","ssh_url":"git@github.com:cuclt/fels_191.git","clone_url":"https://github.com/cuclt/fels_191.git","svn_url":"https://github.com/cuclt/fels_191","homepage":null,"size":91,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"framgia:develop","ref":"develop","sha":"df14f2b96a0265de5293ab78c4c3200a23124714","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":69449476,"name":"fels_191","full_name":"framgia/fels_191","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/fels_191","description":"Framgia E Learning System (Training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_191","forks_url":"https://api.github.com/repos/framgia/fels_191/forks","keys_url":"https://api.github.com/repos/framgia/fels_191/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_191/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_191/teams","hooks_url":"https://api.github.com/repos/framgia/fels_191/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_191/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_191/events","assignees_url":"https://api.github.com/repos/framgia/fels_191/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_191/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_191/tags","blobs_url":"https://api.github.com/repos/framgia/fels_191/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_191/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_191/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_191/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_191/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_191/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_191/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_191/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_191/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_191/subscription","commits_url":"https://api.github.com/repos/framgia/fels_191/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_191/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_191/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_191/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fels_191/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_191/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_191/merges","archive_url":"https://api.github.com/repos/framgia/fels_191/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_191/downloads","issues_url":"https://api.github.com/repos/framgia/fels_191/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_191/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_191/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_191/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_191/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_191/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fels_191/deployments","created_at":"2016-09-28T09:46:37Z","updated_at":"2016-09-28T09:59:19Z","pushed_at":"2016-10-10T12:26:26Z","git_url":"git://github.com/framgia/fels_191.git","ssh_url":"git@github.com:framgia/fels_191.git","clone_url":"https://github.com/framgia/fels_191.git","svn_url":"https://github.com/framgia/fels_191","homepage":null,"size":75,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_191/pulls/17"},"html":{"href":"https://github.com/framgia/fels_191/pull/17"},"issue":{"href":"https://api.github.com/repos/framgia/fels_191/issues/17"},"comments":{"href":"https://api.github.com/repos/framgia/fels_191/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_191/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_191/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_191/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_191/statuses/17983484c81191a0c4b6cfe66211373a68089d29"}}}}
{"actor":{"display_login":"nvtanh"}}