{"action":"created","comment":{"url":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/comments/145772936","pull_request_review_id":70623590,"id":145772936,"diff_hunk":"@@ -2,11 +2,15 @@\n \n class DashboardController < ApplicationController\n   def index\n-    @reasons = Reason.all.joins(:posts)\n-                     .group('reasons.id')\n-                     .select('reasons.*, count(\\'posts.*\\') as post_count')\n-                     .order('inactive ASC, post_count DESC')\n-                     .to_a\n+    @inactive_reasons, @active_reasons = [true, false].map do |inactive|\n+      Reason.all.joins(:posts)\n+            .where(\"reasons.inactive = #{inactive}\")","path":"app/controllers/dashboard_controller.rb","position":11,"original_position":11,"commit_id":"61cb9c5dbabb7ae0d05e614d5a5d25351d2a153a","original_commit_id":"61cb9c5dbabb7ae0d05e614d5a5d25351d2a153a","user":{"login":"ArtOfCode-","id":10406565,"avatar_url":"https://avatars0.githubusercontent.com/u/10406565?v=4","gravatar_id":"","url":"https://api.github.com/users/ArtOfCode-","html_url":"https://github.com/ArtOfCode-","followers_url":"https://api.github.com/users/ArtOfCode-/followers","following_url":"https://api.github.com/users/ArtOfCode-/following{/other_user}","gists_url":"https://api.github.com/users/ArtOfCode-/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtOfCode-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtOfCode-/subscriptions","organizations_url":"https://api.github.com/users/ArtOfCode-/orgs","repos_url":"https://api.github.com/users/ArtOfCode-/repos","events_url":"https://api.github.com/users/ArtOfCode-/events{/privacy}","received_events_url":"https://api.github.com/users/ArtOfCode-/received_events","type":"User","site_admin":false},"body":"Heh, so it is. I'm so used to setting variables from params that I didn't notice :)","created_at":"2017-10-19T17:44:44Z","updated_at":"2017-10-19T17:44:44Z","html_url":"https://github.com/Charcoal-SE/metasmoke/pull/266#discussion_r145772936","pull_request_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/266","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/comments/145772936"},"html":{"href":"https://github.com/Charcoal-SE/metasmoke/pull/266#discussion_r145772936"},"pull_request":{"href":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/266"}},"in_reply_to_id":145745796},"pull_request":{"url":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/266","id":146325579,"html_url":"https://github.com/Charcoal-SE/metasmoke/pull/266","diff_url":"https://github.com/Charcoal-SE/metasmoke/pull/266.diff","patch_url":"https://github.com/Charcoal-SE/metasmoke/pull/266.patch","issue_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/issues/266","number":266,"state":"open","locked":false,"title":"Split table to sort active and inactive reasons separately","user":{"login":"serixscorpio","id":1740566,"avatar_url":"https://avatars0.githubusercontent.com/u/1740566?v=4","gravatar_id":"","url":"https://api.github.com/users/serixscorpio","html_url":"https://github.com/serixscorpio","followers_url":"https://api.github.com/users/serixscorpio/followers","following_url":"https://api.github.com/users/serixscorpio/following{/other_user}","gists_url":"https://api.github.com/users/serixscorpio/gists{/gist_id}","starred_url":"https://api.github.com/users/serixscorpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serixscorpio/subscriptions","organizations_url":"https://api.github.com/users/serixscorpio/orgs","repos_url":"https://api.github.com/users/serixscorpio/repos","events_url":"https://api.github.com/users/serixscorpio/events{/privacy}","received_events_url":"https://api.github.com/users/serixscorpio/received_events","type":"User","site_admin":false},"body":"closes https://github.com/Charcoal-SE/metasmoke/issues/157\r\n\r\n1. Active and inactive reasons can be sorted separately.\r\n2. Inactive reasons is below active reason.\r\n3. Assume the 'n' part of  'n filters have caught m posts' should still\r\ndisplay total number of reasons instead of number of active reasons.\r\n\r\nNote: the column widths of the two tables are not guaranteed to be the\r\nsame since the widths depend on the length of contents for active and\r\ninactive reasons, respectively.  From a practical standpoint, the width\r\nshould normalize to be about the same given enough content.\r\n\r\n![peek 2017-10-12 17-56](https://user-images.githubusercontent.com/1740566/31521301-eb8f1f4c-af76-11e7-9e46-b8f1f5542c38.gif)\r\n","created_at":"2017-10-12T21:59:03Z","updated_at":"2017-10-19T17:44:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bef922e0d6826514865d21b560398d783921eb2e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/266/commits","review_comments_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/266/comments","review_comment_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/issues/266/comments","statuses_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/statuses/61cb9c5dbabb7ae0d05e614d5a5d25351d2a153a","head":{"label":"serixscorpio:sort-disabled-reasons-separately","ref":"sort-disabled-reasons-separately","sha":"61cb9c5dbabb7ae0d05e614d5a5d25351d2a153a","user":{"login":"serixscorpio","id":1740566,"avatar_url":"https://avatars0.githubusercontent.com/u/1740566?v=4","gravatar_id":"","url":"https://api.github.com/users/serixscorpio","html_url":"https://github.com/serixscorpio","followers_url":"https://api.github.com/users/serixscorpio/followers","following_url":"https://api.github.com/users/serixscorpio/following{/other_user}","gists_url":"https://api.github.com/users/serixscorpio/gists{/gist_id}","starred_url":"https://api.github.com/users/serixscorpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serixscorpio/subscriptions","organizations_url":"https://api.github.com/users/serixscorpio/orgs","repos_url":"https://api.github.com/users/serixscorpio/repos","events_url":"https://api.github.com/users/serixscorpio/events{/privacy}","received_events_url":"https://api.github.com/users/serixscorpio/received_events","type":"User","site_admin":false},"repo":{"id":106472194,"name":"metasmoke","full_name":"serixscorpio/metasmoke","owner":{"login":"serixscorpio","id":1740566,"avatar_url":"https://avatars0.githubusercontent.com/u/1740566?v=4","gravatar_id":"","url":"https://api.github.com/users/serixscorpio","html_url":"https://github.com/serixscorpio","followers_url":"https://api.github.com/users/serixscorpio/followers","following_url":"https://api.github.com/users/serixscorpio/following{/other_user}","gists_url":"https://api.github.com/users/serixscorpio/gists{/gist_id}","starred_url":"https://api.github.com/users/serixscorpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serixscorpio/subscriptions","organizations_url":"https://api.github.com/users/serixscorpio/orgs","repos_url":"https://api.github.com/users/serixscorpio/repos","events_url":"https://api.github.com/users/serixscorpio/events{/privacy}","received_events_url":"https://api.github.com/users/serixscorpio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/serixscorpio/metasmoke","description":"Web dashboard for SmokeDetector.","fork":true,"url":"https://api.github.com/repos/serixscorpio/metasmoke","forks_url":"https://api.github.com/repos/serixscorpio/metasmoke/forks","keys_url":"https://api.github.com/repos/serixscorpio/metasmoke/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serixscorpio/metasmoke/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serixscorpio/metasmoke/teams","hooks_url":"https://api.github.com/repos/serixscorpio/metasmoke/hooks","issue_events_url":"https://api.github.com/repos/serixscorpio/metasmoke/issues/events{/number}","events_url":"https://api.github.com/repos/serixscorpio/metasmoke/events","assignees_url":"https://api.github.com/repos/serixscorpio/metasmoke/assignees{/user}","branches_url":"https://api.github.com/repos/serixscorpio/metasmoke/branches{/branch}","tags_url":"https://api.github.com/repos/serixscorpio/metasmoke/tags","blobs_url":"https://api.github.com/repos/serixscorpio/metasmoke/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serixscorpio/metasmoke/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serixscorpio/metasmoke/git/refs{/sha}","trees_url":"https://api.github.com/repos/serixscorpio/metasmoke/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serixscorpio/metasmoke/statuses/{sha}","languages_url":"https://api.github.com/repos/serixscorpio/metasmoke/languages","stargazers_url":"https://api.github.com/repos/serixscorpio/metasmoke/stargazers","contributors_url":"https://api.github.com/repos/serixscorpio/metasmoke/contributors","subscribers_url":"https://api.github.com/repos/serixscorpio/metasmoke/subscribers","subscription_url":"https://api.github.com/repos/serixscorpio/metasmoke/subscription","commits_url":"https://api.github.com/repos/serixscorpio/metasmoke/commits{/sha}","git_commits_url":"https://api.github.com/repos/serixscorpio/metasmoke/git/commits{/sha}","comments_url":"https://api.github.com/repos/serixscorpio/metasmoke/comments{/number}","issue_comment_url":"https://api.github.com/repos/serixscorpio/metasmoke/issues/comments{/number}","contents_url":"https://api.github.com/repos/serixscorpio/metasmoke/contents/{+path}","compare_url":"https://api.github.com/repos/serixscorpio/metasmoke/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serixscorpio/metasmoke/merges","archive_url":"https://api.github.com/repos/serixscorpio/metasmoke/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serixscorpio/metasmoke/downloads","issues_url":"https://api.github.com/repos/serixscorpio/metasmoke/issues{/number}","pulls_url":"https://api.github.com/repos/serixscorpio/metasmoke/pulls{/number}","milestones_url":"https://api.github.com/repos/serixscorpio/metasmoke/milestones{/number}","notifications_url":"https://api.github.com/repos/serixscorpio/metasmoke/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serixscorpio/metasmoke/labels{/name}","releases_url":"https://api.github.com/repos/serixscorpio/metasmoke/releases{/id}","deployments_url":"https://api.github.com/repos/serixscorpio/metasmoke/deployments","created_at":"2017-10-10T21:14:18Z","updated_at":"2017-10-10T21:14:21Z","pushed_at":"2017-10-13T01:52:50Z","git_url":"git://github.com/serixscorpio/metasmoke.git","ssh_url":"git@github.com:serixscorpio/metasmoke.git","clone_url":"https://github.com/serixscorpio/metasmoke.git","svn_url":"https://github.com/serixscorpio/metasmoke","homepage":"https://metasmoke.erwaysoftware.com","size":2043,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"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":"Charcoal-SE:master","ref":"master","sha":"097ac5138b9c3618589dc422219d871c969ee035","user":{"login":"Charcoal-SE","id":6485770,"avatar_url":"https://avatars0.githubusercontent.com/u/6485770?v=4","gravatar_id":"","url":"https://api.github.com/users/Charcoal-SE","html_url":"https://github.com/Charcoal-SE","followers_url":"https://api.github.com/users/Charcoal-SE/followers","following_url":"https://api.github.com/users/Charcoal-SE/following{/other_user}","gists_url":"https://api.github.com/users/Charcoal-SE/gists{/gist_id}","starred_url":"https://api.github.com/users/Charcoal-SE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Charcoal-SE/subscriptions","organizations_url":"https://api.github.com/users/Charcoal-SE/orgs","repos_url":"https://api.github.com/users/Charcoal-SE/repos","events_url":"https://api.github.com/users/Charcoal-SE/events{/privacy}","received_events_url":"https://api.github.com/users/Charcoal-SE/received_events","type":"Organization","site_admin":false},"repo":{"id":40737996,"name":"metasmoke","full_name":"Charcoal-SE/metasmoke","owner":{"login":"Charcoal-SE","id":6485770,"avatar_url":"https://avatars0.githubusercontent.com/u/6485770?v=4","gravatar_id":"","url":"https://api.github.com/users/Charcoal-SE","html_url":"https://github.com/Charcoal-SE","followers_url":"https://api.github.com/users/Charcoal-SE/followers","following_url":"https://api.github.com/users/Charcoal-SE/following{/other_user}","gists_url":"https://api.github.com/users/Charcoal-SE/gists{/gist_id}","starred_url":"https://api.github.com/users/Charcoal-SE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Charcoal-SE/subscriptions","organizations_url":"https://api.github.com/users/Charcoal-SE/orgs","repos_url":"https://api.github.com/users/Charcoal-SE/repos","events_url":"https://api.github.com/users/Charcoal-SE/events{/privacy}","received_events_url":"https://api.github.com/users/Charcoal-SE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Charcoal-SE/metasmoke","description":"Web dashboard for SmokeDetector.","fork":false,"url":"https://api.github.com/repos/Charcoal-SE/metasmoke","forks_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/forks","keys_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/teams","hooks_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/hooks","issue_events_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/issues/events{/number}","events_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/events","assignees_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/assignees{/user}","branches_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/branches{/branch}","tags_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/tags","blobs_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/git/refs{/sha}","trees_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/statuses/{sha}","languages_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/languages","stargazers_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/stargazers","contributors_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/contributors","subscribers_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/subscribers","subscription_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/subscription","commits_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/commits{/sha}","git_commits_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/git/commits{/sha}","comments_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/comments{/number}","issue_comment_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/issues/comments{/number}","contents_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/contents/{+path}","compare_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/merges","archive_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/downloads","issues_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/issues{/number}","pulls_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls{/number}","milestones_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/milestones{/number}","notifications_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/labels{/name}","releases_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/releases{/id}","deployments_url":"https://api.github.com/repos/Charcoal-SE/metasmoke/deployments","created_at":"2015-08-14T22:08:50Z","updated_at":"2017-09-04T21:53:05Z","pushed_at":"2017-10-13T19:41:29Z","git_url":"git://github.com/Charcoal-SE/metasmoke.git","ssh_url":"git@github.com:Charcoal-SE/metasmoke.git","clone_url":"https://github.com/Charcoal-SE/metasmoke.git","svn_url":"https://github.com/Charcoal-SE/metasmoke","homepage":"https://metasmoke.erwaysoftware.com","size":2040,"stargazers_count":20,"watchers_count":20,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":27,"forks":16,"open_issues":27,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/266"},"html":{"href":"https://github.com/Charcoal-SE/metasmoke/pull/266"},"issue":{"href":"https://api.github.com/repos/Charcoal-SE/metasmoke/issues/266"},"comments":{"href":"https://api.github.com/repos/Charcoal-SE/metasmoke/issues/266/comments"},"review_comments":{"href":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/266/comments"},"review_comment":{"href":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Charcoal-SE/metasmoke/pulls/266/commits"},"statuses":{"href":"https://api.github.com/repos/Charcoal-SE/metasmoke/statuses/61cb9c5dbabb7ae0d05e614d5a5d25351d2a153a"}},"author_association":"NONE"}}
{"actor":{"display_login":"ArtOfCode-"}}