{"action":"created","comment":{"url":"https://api.github.com/repos/otwcode/otwarchive/pulls/comments/154363683","pull_request_review_id":80518517,"id":154363683,"diff_hunk":"@@ -25,7 +36,58 @@ def document(object)\n     object.as_json(\n       root: false,\n       only: [:id, :user_id, :name, :description, :created_at],\n-      methods: [:user_login]\n-    )\n+      methods: [\n+        :user_login,\n+        :byline,\n+        :collection_ids\n+      ]\n+    ).merge(extras(object).as_json)\n+  end\n+\n+  def extras(pseud)\n+    work_counts = work_counts(pseud)\n+    {\n+      sortable_name: pseud.name.downcase,\n+      fandoms: fandoms(pseud),\n+      public_bookmarks_count: public_bookmarks_count(pseud),\n+      general_works_count: work_counts.values.sum,\n+      public_works_count: work_counts[false]\n+    }\n+  end\n+\n+  private\n+\n+  def fandoms(pseud)\n+    tag_info(pseud, \"Fandom\")\n+  end\n+\n+  # Produces an array of hashes with the format\n+  # [{id: 1, name: \"Star Trek\", count: 5}]\n+  def tag_info(pseud, tag_type)\n+    pseud.direct_filters.where(works: countable_works_conditions).\n+                         by_type(tag_type).\n+                         group_by(&:id).","path":"app/models/search/pseud_indexer.rb","position":57,"original_position":57,"commit_id":"b58d32df04827a48021b9fc4ed779a64d91e33fc","original_commit_id":"b58d32df04827a48021b9fc4ed779a64d91e33fc","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Use 2 (not 21) spaces for indenting an expression spanning multiple lines.","created_at":"2017-12-01T14:54:34Z","updated_at":"2017-12-01T14:54:35Z","html_url":"https://github.com/otwcode/otwarchive/pull/3191#discussion_r154363683","pull_request_url":"https://api.github.com/repos/otwcode/otwarchive/pulls/3191","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/otwcode/otwarchive/pulls/comments/154363683"},"html":{"href":"https://github.com/otwcode/otwarchive/pull/3191#discussion_r154363683"},"pull_request":{"href":"https://api.github.com/repos/otwcode/otwarchive/pulls/3191"}}},"pull_request":{"url":"https://api.github.com/repos/otwcode/otwarchive/pulls/3191","id":155769319,"html_url":"https://github.com/otwcode/otwarchive/pull/3191","diff_url":"https://github.com/otwcode/otwarchive/pull/3191.diff","patch_url":"https://github.com/otwcode/otwarchive/pull/3191.patch","issue_url":"https://api.github.com/repos/otwcode/otwarchive/issues/3191","number":3191,"state":"open","locked":false,"title":"AO3-5226: People Search","user":{"login":"elzj","id":271307,"avatar_url":"https://avatars0.githubusercontent.com/u/271307?v=4","gravatar_id":"","url":"https://api.github.com/users/elzj","html_url":"https://github.com/elzj","followers_url":"https://api.github.com/users/elzj/followers","following_url":"https://api.github.com/users/elzj/following{/other_user}","gists_url":"https://api.github.com/users/elzj/gists{/gist_id}","starred_url":"https://api.github.com/users/elzj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elzj/subscriptions","organizations_url":"https://api.github.com/users/elzj/orgs","repos_url":"https://api.github.com/users/elzj/repos","events_url":"https://api.github.com/users/elzj/events{/privacy}","received_events_url":"https://api.github.com/users/elzj/received_events","type":"User","site_admin":false},"body":"## Issue\r\n\r\nhttps://otwarchive.atlassian.net/browse/AO3-5226\r\n\r\n## Purpose\r\n\r\nUpdates people search to add an autocomplete field and a fandom search. Also simplifies some unnecessary people pages that we weren't really using.\r\n\r\n## Testing\r\n\r\nSee issue.","created_at":"2017-12-01T02:32:04Z","updated_at":"2017-12-01T14:54:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e32ab973ec81388e28f3c66d004a63946f930af1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/otwcode/otwarchive/pulls/3191/commits","review_comments_url":"https://api.github.com/repos/otwcode/otwarchive/pulls/3191/comments","review_comment_url":"https://api.github.com/repos/otwcode/otwarchive/pulls/comments{/number}","comments_url":"https://api.github.com/repos/otwcode/otwarchive/issues/3191/comments","statuses_url":"https://api.github.com/repos/otwcode/otwarchive/statuses/b58d32df04827a48021b9fc4ed779a64d91e33fc","head":{"label":"elzj:AO3-5226-people-search","ref":"AO3-5226-people-search","sha":"b58d32df04827a48021b9fc4ed779a64d91e33fc","user":{"login":"elzj","id":271307,"avatar_url":"https://avatars0.githubusercontent.com/u/271307?v=4","gravatar_id":"","url":"https://api.github.com/users/elzj","html_url":"https://github.com/elzj","followers_url":"https://api.github.com/users/elzj/followers","following_url":"https://api.github.com/users/elzj/following{/other_user}","gists_url":"https://api.github.com/users/elzj/gists{/gist_id}","starred_url":"https://api.github.com/users/elzj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elzj/subscriptions","organizations_url":"https://api.github.com/users/elzj/orgs","repos_url":"https://api.github.com/users/elzj/repos","events_url":"https://api.github.com/users/elzj/events{/privacy}","received_events_url":"https://api.github.com/users/elzj/received_events","type":"User","site_admin":false},"repo":{"id":1340076,"name":"otwarchive","full_name":"elzj/otwarchive","owner":{"login":"elzj","id":271307,"avatar_url":"https://avatars0.githubusercontent.com/u/271307?v=4","gravatar_id":"","url":"https://api.github.com/users/elzj","html_url":"https://github.com/elzj","followers_url":"https://api.github.com/users/elzj/followers","following_url":"https://api.github.com/users/elzj/following{/other_user}","gists_url":"https://api.github.com/users/elzj/gists{/gist_id}","starred_url":"https://api.github.com/users/elzj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elzj/subscriptions","organizations_url":"https://api.github.com/users/elzj/orgs","repos_url":"https://api.github.com/users/elzj/repos","events_url":"https://api.github.com/users/elzj/events{/privacy}","received_events_url":"https://api.github.com/users/elzj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/elzj/otwarchive","description":"The Organization for Transformative Works - Archive Project","fork":true,"url":"https://api.github.com/repos/elzj/otwarchive","forks_url":"https://api.github.com/repos/elzj/otwarchive/forks","keys_url":"https://api.github.com/repos/elzj/otwarchive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elzj/otwarchive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elzj/otwarchive/teams","hooks_url":"https://api.github.com/repos/elzj/otwarchive/hooks","issue_events_url":"https://api.github.com/repos/elzj/otwarchive/issues/events{/number}","events_url":"https://api.github.com/repos/elzj/otwarchive/events","assignees_url":"https://api.github.com/repos/elzj/otwarchive/assignees{/user}","branches_url":"https://api.github.com/repos/elzj/otwarchive/branches{/branch}","tags_url":"https://api.github.com/repos/elzj/otwarchive/tags","blobs_url":"https://api.github.com/repos/elzj/otwarchive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elzj/otwarchive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elzj/otwarchive/git/refs{/sha}","trees_url":"https://api.github.com/repos/elzj/otwarchive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elzj/otwarchive/statuses/{sha}","languages_url":"https://api.github.com/repos/elzj/otwarchive/languages","stargazers_url":"https://api.github.com/repos/elzj/otwarchive/stargazers","contributors_url":"https://api.github.com/repos/elzj/otwarchive/contributors","subscribers_url":"https://api.github.com/repos/elzj/otwarchive/subscribers","subscription_url":"https://api.github.com/repos/elzj/otwarchive/subscription","commits_url":"https://api.github.com/repos/elzj/otwarchive/commits{/sha}","git_commits_url":"https://api.github.com/repos/elzj/otwarchive/git/commits{/sha}","comments_url":"https://api.github.com/repos/elzj/otwarchive/comments{/number}","issue_comment_url":"https://api.github.com/repos/elzj/otwarchive/issues/comments{/number}","contents_url":"https://api.github.com/repos/elzj/otwarchive/contents/{+path}","compare_url":"https://api.github.com/repos/elzj/otwarchive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elzj/otwarchive/merges","archive_url":"https://api.github.com/repos/elzj/otwarchive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elzj/otwarchive/downloads","issues_url":"https://api.github.com/repos/elzj/otwarchive/issues{/number}","pulls_url":"https://api.github.com/repos/elzj/otwarchive/pulls{/number}","milestones_url":"https://api.github.com/repos/elzj/otwarchive/milestones{/number}","notifications_url":"https://api.github.com/repos/elzj/otwarchive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elzj/otwarchive/labels{/name}","releases_url":"https://api.github.com/repos/elzj/otwarchive/releases{/id}","deployments_url":"https://api.github.com/repos/elzj/otwarchive/deployments","created_at":"2011-02-08T00:13:20Z","updated_at":"2016-08-26T13:58:21Z","pushed_at":"2017-12-01T14:54:16Z","git_url":"git://github.com/elzj/otwarchive.git","ssh_url":"git@github.com:elzj/otwarchive.git","clone_url":"https://github.com/elzj/otwarchive.git","svn_url":"https://github.com/elzj/otwarchive","homepage":"http://transformativeworks.org/projects/archive","size":54309,"stargazers_count":3,"watchers_count":3,"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":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"otwcode:master","ref":"master","sha":"09d2e037db9bf37e11ff085b04640ded171e2399","user":{"login":"otwcode","id":408606,"avatar_url":"https://avatars2.githubusercontent.com/u/408606?v=4","gravatar_id":"","url":"https://api.github.com/users/otwcode","html_url":"https://github.com/otwcode","followers_url":"https://api.github.com/users/otwcode/followers","following_url":"https://api.github.com/users/otwcode/following{/other_user}","gists_url":"https://api.github.com/users/otwcode/gists{/gist_id}","starred_url":"https://api.github.com/users/otwcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otwcode/subscriptions","organizations_url":"https://api.github.com/users/otwcode/orgs","repos_url":"https://api.github.com/users/otwcode/repos","events_url":"https://api.github.com/users/otwcode/events{/privacy}","received_events_url":"https://api.github.com/users/otwcode/received_events","type":"Organization","site_admin":false},"repo":{"id":1338040,"name":"otwarchive","full_name":"otwcode/otwarchive","owner":{"login":"otwcode","id":408606,"avatar_url":"https://avatars2.githubusercontent.com/u/408606?v=4","gravatar_id":"","url":"https://api.github.com/users/otwcode","html_url":"https://github.com/otwcode","followers_url":"https://api.github.com/users/otwcode/followers","following_url":"https://api.github.com/users/otwcode/following{/other_user}","gists_url":"https://api.github.com/users/otwcode/gists{/gist_id}","starred_url":"https://api.github.com/users/otwcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otwcode/subscriptions","organizations_url":"https://api.github.com/users/otwcode/orgs","repos_url":"https://api.github.com/users/otwcode/repos","events_url":"https://api.github.com/users/otwcode/events{/privacy}","received_events_url":"https://api.github.com/users/otwcode/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/otwcode/otwarchive","description":"The Organization for Transformative Works (OTW) - Archive Of Our Own (AO3) Project","fork":false,"url":"https://api.github.com/repos/otwcode/otwarchive","forks_url":"https://api.github.com/repos/otwcode/otwarchive/forks","keys_url":"https://api.github.com/repos/otwcode/otwarchive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/otwcode/otwarchive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/otwcode/otwarchive/teams","hooks_url":"https://api.github.com/repos/otwcode/otwarchive/hooks","issue_events_url":"https://api.github.com/repos/otwcode/otwarchive/issues/events{/number}","events_url":"https://api.github.com/repos/otwcode/otwarchive/events","assignees_url":"https://api.github.com/repos/otwcode/otwarchive/assignees{/user}","branches_url":"https://api.github.com/repos/otwcode/otwarchive/branches{/branch}","tags_url":"https://api.github.com/repos/otwcode/otwarchive/tags","blobs_url":"https://api.github.com/repos/otwcode/otwarchive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/otwcode/otwarchive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/otwcode/otwarchive/git/refs{/sha}","trees_url":"https://api.github.com/repos/otwcode/otwarchive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/otwcode/otwarchive/statuses/{sha}","languages_url":"https://api.github.com/repos/otwcode/otwarchive/languages","stargazers_url":"https://api.github.com/repos/otwcode/otwarchive/stargazers","contributors_url":"https://api.github.com/repos/otwcode/otwarchive/contributors","subscribers_url":"https://api.github.com/repos/otwcode/otwarchive/subscribers","subscription_url":"https://api.github.com/repos/otwcode/otwarchive/subscription","commits_url":"https://api.github.com/repos/otwcode/otwarchive/commits{/sha}","git_commits_url":"https://api.github.com/repos/otwcode/otwarchive/git/commits{/sha}","comments_url":"https://api.github.com/repos/otwcode/otwarchive/comments{/number}","issue_comment_url":"https://api.github.com/repos/otwcode/otwarchive/issues/comments{/number}","contents_url":"https://api.github.com/repos/otwcode/otwarchive/contents/{+path}","compare_url":"https://api.github.com/repos/otwcode/otwarchive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/otwcode/otwarchive/merges","archive_url":"https://api.github.com/repos/otwcode/otwarchive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/otwcode/otwarchive/downloads","issues_url":"https://api.github.com/repos/otwcode/otwarchive/issues{/number}","pulls_url":"https://api.github.com/repos/otwcode/otwarchive/pulls{/number}","milestones_url":"https://api.github.com/repos/otwcode/otwarchive/milestones{/number}","notifications_url":"https://api.github.com/repos/otwcode/otwarchive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/otwcode/otwarchive/labels{/name}","releases_url":"https://api.github.com/repos/otwcode/otwarchive/releases{/id}","deployments_url":"https://api.github.com/repos/otwcode/otwarchive/deployments","created_at":"2011-02-07T14:50:58Z","updated_at":"2017-11-28T18:12:28Z","pushed_at":"2017-12-01T14:54:18Z","git_url":"git://github.com/otwcode/otwarchive.git","ssh_url":"git@github.com:otwcode/otwarchive.git","clone_url":"https://github.com/otwcode/otwarchive.git","svn_url":"https://github.com/otwcode/otwarchive","homepage":"http://www.transformativeworks.org/archive_of_our_own/","size":53902,"stargazers_count":294,"watchers_count":294,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":171,"mirror_url":null,"archived":false,"open_issues_count":102,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":171,"open_issues":102,"watchers":294,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/otwcode/otwarchive/pulls/3191"},"html":{"href":"https://github.com/otwcode/otwarchive/pull/3191"},"issue":{"href":"https://api.github.com/repos/otwcode/otwarchive/issues/3191"},"comments":{"href":"https://api.github.com/repos/otwcode/otwarchive/issues/3191/comments"},"review_comments":{"href":"https://api.github.com/repos/otwcode/otwarchive/pulls/3191/comments"},"review_comment":{"href":"https://api.github.com/repos/otwcode/otwarchive/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/otwcode/otwarchive/pulls/3191/commits"},"statuses":{"href":"https://api.github.com/repos/otwcode/otwarchive/statuses/b58d32df04827a48021b9fc4ed779a64d91e33fc"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}