GitHub PullRequestReviewCommentEvent at 2014-07-31 15:17:53
Repository: cs_comments_service
Actor: jimabramson
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/edx/cs_comments_service/pulls/comments/15648293","id":15648293,"diff_hunk":"@@ -72,40 +67,22 @@\n       corrected_text = nil if thread_ids.empty?\n     end\n \n-    results = nil\n-    self.class.trace_execution_scoped([\"Custom/get_search_threads/mongo_sort_page\"]) do\n-      results = CommentThread.\n-        where(:id.in => thread_ids.to_a).\n-        order_by(sort_criteria).\n-        page(page).\n-        per(per_page).\n-        to_a\n-    end\n-    total_results = thread_ids.size\n-    num_pages = (total_results + per_page - 1) / per_page\n-\n-    if results.length == 0\n-      collection = []\n-    else\n-      pres_threads = ThreadListPresenter.new(\n-        results,\n-        local_params[:user_id] ? user : nil,\n-        local_params[:course_id] || results.first.course_id\n-      )\n-      collection = pres_threads.to_hash\n-    end\n-\n-    json_output = nil\n-    self.class.trace_execution_scoped(['Custom/get_search_threads/json_serialize']) do\n-      json_output = {\n-        collection: collection,\n-        corrected_text: corrected_text,\n-        total_results: total_results,\n-        num_pages: num_pages,\n-        page: page,\n-      }.to_json\n+    result_obj = handle_threads_query(\n+      CommentThread.where(:id.in => thread_ids.to_a),\n+      local_params[\"user_id\"],\n+      local_params[\"course_id\"],\n+      value_to_boolean(local_params[\"flagged\"]),\n+      value_to_boolean(local_params[\"unread\"]),\n+      local_params[\"sort_key\"],\n+      local_params[\"sort_order\"],\n+      local_params[\"page\"],\n+      local_params[\"per_page\"]\n+    )\n+    if !result_obj.empty?\n+      result_obj[:corrected_text] = corrected_text\n+      result_obj[:total_results] = thread_ids.size  # FIXME not true for flagged","path":"api/search.rb","position":66,"original_position":66,"commit_id":"b0858db84c69b1a404a943d6b2a291e493e7f88e","original_commit_id":"b0858db84c69b1a404a943d6b2a291e493e7f88e","user":{"login":"jimabramson","id":1349368,"avatar_url":"https://avatars.githubusercontent.com/u/1349368?v=1","gravatar_id":"89b343b23584e805d1b7e47b3460f097","url":"https://api.github.com/users/jimabramson","html_url":"https://github.com/jimabramson","followers_url":"https://api.github.com/users/jimabramson/followers","following_url":"https://api.github.com/users/jimabramson/following{/other_user}","gists_url":"https://api.github.com/users/jimabramson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimabramson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimabramson/subscriptions","organizations_url":"https://api.github.com/users/jimabramson/orgs","repos_url":"https://api.github.com/users/jimabramson/repos","events_url":"https://api.github.com/users/jimabramson/events{/privacy}","received_events_url":"https://api.github.com/users/jimabramson/received_events","type":"User","site_admin":false},"body":"i was just thinking we should set it to nil/None when we know it's not valid. ","created_at":"2014-07-31T15:17:53Z","updated_at":"2014-07-31T15:17:53Z","html_url":"https://github.com/edx/cs_comments_service/pull/112#discussion_r15648293","pull_request_url":"https://api.github.com/repos/edx/cs_comments_service/pulls/112","_links":{"self":{"href":"https://api.github.com/repos/edx/cs_comments_service/pulls/comments/15648293"},"html":{"href":"https://github.com/edx/cs_comments_service/pull/112#discussion_r15648293"},"pull_request":{"href":"https://api.github.com/repos/edx/cs_comments_service/pulls/112"}}},"pull_request":{"url":"https://api.github.com/repos/edx/cs_comments_service/pulls/112","id":19125552,"html_url":"https://github.com/edx/cs_comments_service/pull/112","diff_url":"https://github.com/edx/cs_comments_service/pull/112.diff","patch_url":"https://github.com/edx/cs_comments_service/pull/112.patch","issue_url":"https://api.github.com/repos/edx/cs_comments_service/issues/112","number":112,"state":"open","title":"Add “unread” thread list filter, and refactor the “flagged” filter.","user":{"login":"jimabramson","id":1349368,"avatar_url":"https://avatars.githubusercontent.com/u/1349368?v=1","gravatar_id":"89b343b23584e805d1b7e47b3460f097","url":"https://api.github.com/users/jimabramson","html_url":"https://github.com/jimabramson","followers_url":"https://api.github.com/users/jimabramson/followers","following_url":"https://api.github.com/users/jimabramson/following{/other_user}","gists_url":"https://api.github.com/users/jimabramson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimabramson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimabramson/subscriptions","organizations_url":"https://api.github.com/users/jimabramson/orgs","repos_url":"https://api.github.com/users/jimabramson/repos","events_url":"https://api.github.com/users/jimabramson/events{/privacy}","received_events_url":"https://api.github.com/users/jimabramson/received_events","type":"User","site_admin":false},"body":"@gwprice","created_at":"2014-07-30T23:55:51Z","updated_at":"2014-07-31T15:17:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e45ca4ab73d7defe099446eb96dba3e9d6069e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/cs_comments_service/pulls/112/commits","review_comments_url":"https://api.github.com/repos/edx/cs_comments_service/pulls/112/comments","review_comment_url":"https://api.github.com/repos/edx/cs_comments_service/pulls/comments/{number}","comments_url":"https://api.github.com/repos/edx/cs_comments_service/issues/112/comments","statuses_url":"https://api.github.com/repos/edx/cs_comments_service/statuses/b0858db84c69b1a404a943d6b2a291e493e7f88e","head":{"label":"edx:jsa/thread-filters","ref":"jsa/thread-filters","sha":"b0858db84c69b1a404a943d6b2a291e493e7f88e","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=1","gravatar_id":"e1f6c6dc8772c47c0261cd5df2ed2814","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":4732120,"name":"cs_comments_service","full_name":"edx/cs_comments_service","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=1","gravatar_id":"e1f6c6dc8772c47c0261cd5df2ed2814","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/cs_comments_service","description":"server side of the comment service","fork":false,"url":"https://api.github.com/repos/edx/cs_comments_service","forks_url":"https://api.github.com/repos/edx/cs_comments_service/forks","keys_url":"https://api.github.com/repos/edx/cs_comments_service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/cs_comments_service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/cs_comments_service/teams","hooks_url":"https://api.github.com/repos/edx/cs_comments_service/hooks","issue_events_url":"https://api.github.com/repos/edx/cs_comments_service/issues/events{/number}","events_url":"https://api.github.com/repos/edx/cs_comments_service/events","assignees_url":"https://api.github.com/repos/edx/cs_comments_service/assignees{/user}","branches_url":"https://api.github.com/repos/edx/cs_comments_service/branches{/branch}","tags_url":"https://api.github.com/repos/edx/cs_comments_service/tags","blobs_url":"https://api.github.com/repos/edx/cs_comments_service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/cs_comments_service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/cs_comments_service/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/cs_comments_service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/cs_comments_service/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/cs_comments_service/languages","stargazers_url":"https://api.github.com/repos/edx/cs_comments_service/stargazers","contributors_url":"https://api.github.com/repos/edx/cs_comments_service/contributors","subscribers_url":"https://api.github.com/repos/edx/cs_comments_service/subscribers","subscription_url":"https://api.github.com/repos/edx/cs_comments_service/subscription","commits_url":"https://api.github.com/repos/edx/cs_comments_service/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/cs_comments_service/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/cs_comments_service/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/cs_comments_service/issues/comments/{number}","contents_url":"https://api.github.com/repos/edx/cs_comments_service/contents/{+path}","compare_url":"https://api.github.com/repos/edx/cs_comments_service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/cs_comments_service/merges","archive_url":"https://api.github.com/repos/edx/cs_comments_service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/cs_comments_service/downloads","issues_url":"https://api.github.com/repos/edx/cs_comments_service/issues{/number}","pulls_url":"https://api.github.com/repos/edx/cs_comments_service/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/cs_comments_service/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/cs_comments_service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/cs_comments_service/labels{/name}","releases_url":"https://api.github.com/repos/edx/cs_comments_service/releases{/id}","created_at":"2012-06-20T22:12:04Z","updated_at":"2014-07-18T09:28:25Z","pushed_at":"2014-07-30T23:54:29Z","git_url":"git://github.com/edx/cs_comments_service.git","ssh_url":"git@github.com:edx/cs_comments_service.git","clone_url":"https://github.com/edx/cs_comments_service.git","svn_url":"https://github.com/edx/cs_comments_service","homepage":null,"size":4558,"stargazers_count":12,"watchers_count":12,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":41,"mirror_url":null,"open_issues_count":5,"forks":41,"open_issues":5,"watchers":12,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"3021d7163befbb84ddb6e4a1e79fb52bcdaf14c7","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=1","gravatar_id":"e1f6c6dc8772c47c0261cd5df2ed2814","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":4732120,"name":"cs_comments_service","full_name":"edx/cs_comments_service","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=1","gravatar_id":"e1f6c6dc8772c47c0261cd5df2ed2814","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/cs_comments_service","description":"server side of the comment service","fork":false,"url":"https://api.github.com/repos/edx/cs_comments_service","forks_url":"https://api.github.com/repos/edx/cs_comments_service/forks","keys_url":"https://api.github.com/repos/edx/cs_comments_service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/cs_comments_service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/cs_comments_service/teams","hooks_url":"https://api.github.com/repos/edx/cs_comments_service/hooks","issue_events_url":"https://api.github.com/repos/edx/cs_comments_service/issues/events{/number}","events_url":"https://api.github.com/repos/edx/cs_comments_service/events","assignees_url":"https://api.github.com/repos/edx/cs_comments_service/assignees{/user}","branches_url":"https://api.github.com/repos/edx/cs_comments_service/branches{/branch}","tags_url":"https://api.github.com/repos/edx/cs_comments_service/tags","blobs_url":"https://api.github.com/repos/edx/cs_comments_service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/cs_comments_service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/cs_comments_service/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/cs_comments_service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/cs_comments_service/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/cs_comments_service/languages","stargazers_url":"https://api.github.com/repos/edx/cs_comments_service/stargazers","contributors_url":"https://api.github.com/repos/edx/cs_comments_service/contributors","subscribers_url":"https://api.github.com/repos/edx/cs_comments_service/subscribers","subscription_url":"https://api.github.com/repos/edx/cs_comments_service/subscription","commits_url":"https://api.github.com/repos/edx/cs_comments_service/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/cs_comments_service/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/cs_comments_service/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/cs_comments_service/issues/comments/{number}","contents_url":"https://api.github.com/repos/edx/cs_comments_service/contents/{+path}","compare_url":"https://api.github.com/repos/edx/cs_comments_service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/cs_comments_service/merges","archive_url":"https://api.github.com/repos/edx/cs_comments_service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/cs_comments_service/downloads","issues_url":"https://api.github.com/repos/edx/cs_comments_service/issues{/number}","pulls_url":"https://api.github.com/repos/edx/cs_comments_service/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/cs_comments_service/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/cs_comments_service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/cs_comments_service/labels{/name}","releases_url":"https://api.github.com/repos/edx/cs_comments_service/releases{/id}","created_at":"2012-06-20T22:12:04Z","updated_at":"2014-07-18T09:28:25Z","pushed_at":"2014-07-30T23:54:29Z","git_url":"git://github.com/edx/cs_comments_service.git","ssh_url":"git@github.com:edx/cs_comments_service.git","clone_url":"https://github.com/edx/cs_comments_service.git","svn_url":"https://github.com/edx/cs_comments_service","homepage":null,"size":4558,"stargazers_count":12,"watchers_count":12,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":41,"mirror_url":null,"open_issues_count":5,"forks":41,"open_issues":5,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/cs_comments_service/pulls/112"},"html":{"href":"https://github.com/edx/cs_comments_service/pull/112"},"issue":{"href":"https://api.github.com/repos/edx/cs_comments_service/issues/112"},"comments":{"href":"https://api.github.com/repos/edx/cs_comments_service/issues/112/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/cs_comments_service/pulls/112/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/cs_comments_service/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/edx/cs_comments_service/pulls/112/commits"},"statuses":{"href":"https://api.github.com/repos/edx/cs_comments_service/statuses/b0858db84c69b1a404a943d6b2a291e493e7f88e"}}}}