{"action":"created","comment":{"url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/comments/219025634","pull_request_review_id":157095026,"id":219025634,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTAyNTYzNA==","diff_hunk":"@@ -525,7 +531,8 @@\n     # Dione      |         20\n \n     # ------------------ ActiveRecord Solution ----------------------\n-    # custom_results =\n+    custom_results = User.joins(:order_items).select('users.name, count(order_items.id) as total_item_count').group('users.name').order('users.name desc')","path":"spec/models/activerecord_obstacle_course_spec.rb","position":448,"original_position":448,"commit_id":"90a07034c29f62bf20340a67f9e93651ec7ca5c3","original_commit_id":"90a07034c29f62bf20340a67f9e93651ec7ca5c3","user":{"login":"iandouglas","id":168030,"node_id":"MDQ6VXNlcjE2ODAzMA==","avatar_url":"https://avatars0.githubusercontent.com/u/168030?v=4","gravatar_id":"","url":"https://api.github.com/users/iandouglas","html_url":"https://github.com/iandouglas","followers_url":"https://api.github.com/users/iandouglas/followers","following_url":"https://api.github.com/users/iandouglas/following{/other_user}","gists_url":"https://api.github.com/users/iandouglas/gists{/gist_id}","starred_url":"https://api.github.com/users/iandouglas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iandouglas/subscriptions","organizations_url":"https://api.github.com/users/iandouglas/orgs","repos_url":"https://api.github.com/users/iandouglas/repos","events_url":"https://api.github.com/users/iandouglas/events{/privacy}","received_events_url":"https://api.github.com/users/iandouglas/received_events","type":"User","site_admin":false},"body":"because \"users.name\" is an attribute on the User model which started this whole AR chain, you can use symbol notation in your group and order at the end, `.group(:name).order(name: :desc)`","created_at":"2018-09-20T03:35:12Z","updated_at":"2018-09-20T03:35:29Z","html_url":"https://github.com/turingschool-projects/activerecord-obstacle-course/pull/8#discussion_r219025634","pull_request_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/8","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/comments/219025634"},"html":{"href":"https://github.com/turingschool-projects/activerecord-obstacle-course/pull/8#discussion_r219025634"},"pull_request":{"href":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/8","id":213801518,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzODAxNTE4","html_url":"https://github.com/turingschool-projects/activerecord-obstacle-course/pull/8","diff_url":"https://github.com/turingschool-projects/activerecord-obstacle-course/pull/8.diff","patch_url":"https://github.com/turingschool-projects/activerecord-obstacle-course/pull/8.patch","issue_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/issues/8","number":8,"state":"open","locked":false,"title":"Patrick Shobe","user":{"login":"patrickshobe","id":32880860,"node_id":"MDQ6VXNlcjMyODgwODYw","avatar_url":"https://avatars3.githubusercontent.com/u/32880860?v=4","gravatar_id":"","url":"https://api.github.com/users/patrickshobe","html_url":"https://github.com/patrickshobe","followers_url":"https://api.github.com/users/patrickshobe/followers","following_url":"https://api.github.com/users/patrickshobe/following{/other_user}","gists_url":"https://api.github.com/users/patrickshobe/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickshobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickshobe/subscriptions","organizations_url":"https://api.github.com/users/patrickshobe/orgs","repos_url":"https://api.github.com/users/patrickshobe/repos","events_url":"https://api.github.com/users/patrickshobe/events{/privacy}","received_events_url":"https://api.github.com/users/patrickshobe/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-07T02:44:13Z","updated_at":"2018-09-20T03:35:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4df4e37435d8f1e61ce84f0d6986c1c21d1c93d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/8/commits","review_comments_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/8/comments","review_comment_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/comments{/number}","comments_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/issues/8/comments","statuses_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/statuses/90a07034c29f62bf20340a67f9e93651ec7ca5c3","head":{"label":"patrickshobe:master","ref":"master","sha":"90a07034c29f62bf20340a67f9e93651ec7ca5c3","user":{"login":"patrickshobe","id":32880860,"node_id":"MDQ6VXNlcjMyODgwODYw","avatar_url":"https://avatars3.githubusercontent.com/u/32880860?v=4","gravatar_id":"","url":"https://api.github.com/users/patrickshobe","html_url":"https://github.com/patrickshobe","followers_url":"https://api.github.com/users/patrickshobe/followers","following_url":"https://api.github.com/users/patrickshobe/following{/other_user}","gists_url":"https://api.github.com/users/patrickshobe/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickshobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickshobe/subscriptions","organizations_url":"https://api.github.com/users/patrickshobe/orgs","repos_url":"https://api.github.com/users/patrickshobe/repos","events_url":"https://api.github.com/users/patrickshobe/events{/privacy}","received_events_url":"https://api.github.com/users/patrickshobe/received_events","type":"User","site_admin":false},"repo":{"id":147760782,"node_id":"MDEwOlJlcG9zaXRvcnkxNDc3NjA3ODI=","name":"activerecord-obstacle-course","full_name":"patrickshobe/activerecord-obstacle-course","private":false,"owner":{"login":"patrickshobe","id":32880860,"node_id":"MDQ6VXNlcjMyODgwODYw","avatar_url":"https://avatars3.githubusercontent.com/u/32880860?v=4","gravatar_id":"","url":"https://api.github.com/users/patrickshobe","html_url":"https://github.com/patrickshobe","followers_url":"https://api.github.com/users/patrickshobe/followers","following_url":"https://api.github.com/users/patrickshobe/following{/other_user}","gists_url":"https://api.github.com/users/patrickshobe/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickshobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickshobe/subscriptions","organizations_url":"https://api.github.com/users/patrickshobe/orgs","repos_url":"https://api.github.com/users/patrickshobe/repos","events_url":"https://api.github.com/users/patrickshobe/events{/privacy}","received_events_url":"https://api.github.com/users/patrickshobe/received_events","type":"User","site_admin":false},"html_url":"https://github.com/patrickshobe/activerecord-obstacle-course","description":null,"fork":true,"url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course","forks_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/forks","keys_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/keys{/key_id}","collaborators_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/teams","hooks_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/hooks","issue_events_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/issues/events{/number}","events_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/events","assignees_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/assignees{/user}","branches_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/branches{/branch}","tags_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/tags","blobs_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/git/refs{/sha}","trees_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/git/trees{/sha}","statuses_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/statuses/{sha}","languages_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/languages","stargazers_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/stargazers","contributors_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/contributors","subscribers_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/subscribers","subscription_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/subscription","commits_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/commits{/sha}","git_commits_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/git/commits{/sha}","comments_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/comments{/number}","issue_comment_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/issues/comments{/number}","contents_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/contents/{+path}","compare_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/compare/{base}...{head}","merges_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/merges","archive_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/downloads","issues_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/issues{/number}","pulls_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/pulls{/number}","milestones_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/milestones{/number}","notifications_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/labels{/name}","releases_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/releases{/id}","deployments_url":"https://api.github.com/repos/patrickshobe/activerecord-obstacle-course/deployments","created_at":"2018-09-07T02:39:41Z","updated_at":"2018-09-07T02:43:46Z","pushed_at":"2018-09-07T02:43:45Z","git_url":"git://github.com/patrickshobe/activerecord-obstacle-course.git","ssh_url":"git@github.com:patrickshobe/activerecord-obstacle-course.git","clone_url":"https://github.com/patrickshobe/activerecord-obstacle-course.git","svn_url":"https://github.com/patrickshobe/activerecord-obstacle-course","homepage":null,"size":45,"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,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"turingschool-projects:master","ref":"master","sha":"448f0582ca501b6f12c5292f9e872027fdf8cd1c","user":{"login":"turingschool-projects","id":10454571,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNDU0NTcx","avatar_url":"https://avatars3.githubusercontent.com/u/10454571?v=4","gravatar_id":"","url":"https://api.github.com/users/turingschool-projects","html_url":"https://github.com/turingschool-projects","followers_url":"https://api.github.com/users/turingschool-projects/followers","following_url":"https://api.github.com/users/turingschool-projects/following{/other_user}","gists_url":"https://api.github.com/users/turingschool-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/turingschool-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turingschool-projects/subscriptions","organizations_url":"https://api.github.com/users/turingschool-projects/orgs","repos_url":"https://api.github.com/users/turingschool-projects/repos","events_url":"https://api.github.com/users/turingschool-projects/events{/privacy}","received_events_url":"https://api.github.com/users/turingschool-projects/received_events","type":"Organization","site_admin":false},"repo":{"id":144889078,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ4ODkwNzg=","name":"activerecord-obstacle-course","full_name":"turingschool-projects/activerecord-obstacle-course","private":false,"owner":{"login":"turingschool-projects","id":10454571,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNDU0NTcx","avatar_url":"https://avatars3.githubusercontent.com/u/10454571?v=4","gravatar_id":"","url":"https://api.github.com/users/turingschool-projects","html_url":"https://github.com/turingschool-projects","followers_url":"https://api.github.com/users/turingschool-projects/followers","following_url":"https://api.github.com/users/turingschool-projects/following{/other_user}","gists_url":"https://api.github.com/users/turingschool-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/turingschool-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turingschool-projects/subscriptions","organizations_url":"https://api.github.com/users/turingschool-projects/orgs","repos_url":"https://api.github.com/users/turingschool-projects/repos","events_url":"https://api.github.com/users/turingschool-projects/events{/privacy}","received_events_url":"https://api.github.com/users/turingschool-projects/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/turingschool-projects/activerecord-obstacle-course","description":null,"fork":false,"url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course","forks_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/forks","keys_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/keys{/key_id}","collaborators_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/teams","hooks_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/hooks","issue_events_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/issues/events{/number}","events_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/events","assignees_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/assignees{/user}","branches_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/branches{/branch}","tags_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/tags","blobs_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/git/refs{/sha}","trees_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/git/trees{/sha}","statuses_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/statuses/{sha}","languages_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/languages","stargazers_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/stargazers","contributors_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/contributors","subscribers_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/subscribers","subscription_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/subscription","commits_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/commits{/sha}","git_commits_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/git/commits{/sha}","comments_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/comments{/number}","issue_comment_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/issues/comments{/number}","contents_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/contents/{+path}","compare_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/compare/{base}...{head}","merges_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/merges","archive_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/downloads","issues_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/issues{/number}","pulls_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls{/number}","milestones_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/milestones{/number}","notifications_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/labels{/name}","releases_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/releases{/id}","deployments_url":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/deployments","created_at":"2018-08-15T18:28:01Z","updated_at":"2018-08-24T17:13:28Z","pushed_at":"2018-09-20T00:03:08Z","git_url":"git://github.com/turingschool-projects/activerecord-obstacle-course.git","ssh_url":"git@github.com:turingschool-projects/activerecord-obstacle-course.git","clone_url":"https://github.com/turingschool-projects/activerecord-obstacle-course.git","svn_url":"https://github.com/turingschool-projects/activerecord-obstacle-course","homepage":null,"size":42,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":22,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/8"},"html":{"href":"https://github.com/turingschool-projects/activerecord-obstacle-course/pull/8"},"issue":{"href":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/issues/8"},"comments":{"href":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/turingschool-projects/activerecord-obstacle-course/statuses/90a07034c29f62bf20340a67f9e93651ec7ca5c3"}},"author_association":"NONE"}}
{"actor":{"display_login":"iandouglas"}}