{"action":"closed","number":166,"pull_request":{"url":"https://api.github.com/repos/orientation/orientation/pulls/166","id":44979237,"html_url":"https://github.com/orientation/orientation/pull/166","diff_url":"https://github.com/orientation/orientation/pull/166.diff","patch_url":"https://github.com/orientation/orientation/pull/166.patch","issue_url":"https://api.github.com/repos/orientation/orientation/issues/166","number":166,"state":"closed","locked":false,"title":"Using counter cache column over building AR objects","user":{"login":"mattpolito","id":2145,"avatar_url":"https://avatars.githubusercontent.com/u/2145?v=3","gravatar_id":"","url":"https://api.github.com/users/mattpolito","html_url":"https://github.com/mattpolito","followers_url":"https://api.github.com/users/mattpolito/followers","following_url":"https://api.github.com/users/mattpolito/following{/other_user}","gists_url":"https://api.github.com/users/mattpolito/gists{/gist_id}","starred_url":"https://api.github.com/users/mattpolito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattpolito/subscriptions","organizations_url":"https://api.github.com/users/mattpolito/orgs","repos_url":"https://api.github.com/users/mattpolito/repos","events_url":"https://api.github.com/users/mattpolito/events{/privacy}","received_events_url":"https://api.github.com/users/mattpolito/received_events","type":"User","site_admin":false},"body":"More efficient to pull counts from the counter cache than to pull in AR objects just to count them.","created_at":"2015-09-14T20:50:51Z","updated_at":"2015-09-14T20:53:48Z","closed_at":"2015-09-14T20:53:48Z","merged_at":"2015-09-14T20:53:48Z","merge_commit_sha":"78d08f63430e99c464fba6c91094d0011f4dde9b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/orientation/orientation/pulls/166/commits","review_comments_url":"https://api.github.com/repos/orientation/orientation/pulls/166/comments","review_comment_url":"https://api.github.com/repos/orientation/orientation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/orientation/orientation/issues/166/comments","statuses_url":"https://api.github.com/repos/orientation/orientation/statuses/fa362283282240987f164999bfab79cb43a8fb06","head":{"label":"hashrocket:counter_cache","ref":"counter_cache","sha":"fa362283282240987f164999bfab79cb43a8fb06","user":{"login":"hashrocket","id":5875,"avatar_url":"https://avatars.githubusercontent.com/u/5875?v=3","gravatar_id":"","url":"https://api.github.com/users/hashrocket","html_url":"https://github.com/hashrocket","followers_url":"https://api.github.com/users/hashrocket/followers","following_url":"https://api.github.com/users/hashrocket/following{/other_user}","gists_url":"https://api.github.com/users/hashrocket/gists{/gist_id}","starred_url":"https://api.github.com/users/hashrocket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashrocket/subscriptions","organizations_url":"https://api.github.com/users/hashrocket/orgs","repos_url":"https://api.github.com/users/hashrocket/repos","events_url":"https://api.github.com/users/hashrocket/events{/privacy}","received_events_url":"https://api.github.com/users/hashrocket/received_events","type":"Organization","site_admin":false},"repo":{"id":41822829,"name":"orientation","full_name":"hashrocket/orientation","owner":{"login":"hashrocket","id":5875,"avatar_url":"https://avatars.githubusercontent.com/u/5875?v=3","gravatar_id":"","url":"https://api.github.com/users/hashrocket","html_url":"https://github.com/hashrocket","followers_url":"https://api.github.com/users/hashrocket/followers","following_url":"https://api.github.com/users/hashrocket/following{/other_user}","gists_url":"https://api.github.com/users/hashrocket/gists{/gist_id}","starred_url":"https://api.github.com/users/hashrocket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashrocket/subscriptions","organizations_url":"https://api.github.com/users/hashrocket/orgs","repos_url":"https://api.github.com/users/hashrocket/repos","events_url":"https://api.github.com/users/hashrocket/events{/privacy}","received_events_url":"https://api.github.com/users/hashrocket/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashrocket/orientation","description":"Fight information rot.","fork":true,"url":"https://api.github.com/repos/hashrocket/orientation","forks_url":"https://api.github.com/repos/hashrocket/orientation/forks","keys_url":"https://api.github.com/repos/hashrocket/orientation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashrocket/orientation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashrocket/orientation/teams","hooks_url":"https://api.github.com/repos/hashrocket/orientation/hooks","issue_events_url":"https://api.github.com/repos/hashrocket/orientation/issues/events{/number}","events_url":"https://api.github.com/repos/hashrocket/orientation/events","assignees_url":"https://api.github.com/repos/hashrocket/orientation/assignees{/user}","branches_url":"https://api.github.com/repos/hashrocket/orientation/branches{/branch}","tags_url":"https://api.github.com/repos/hashrocket/orientation/tags","blobs_url":"https://api.github.com/repos/hashrocket/orientation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashrocket/orientation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashrocket/orientation/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashrocket/orientation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashrocket/orientation/statuses/{sha}","languages_url":"https://api.github.com/repos/hashrocket/orientation/languages","stargazers_url":"https://api.github.com/repos/hashrocket/orientation/stargazers","contributors_url":"https://api.github.com/repos/hashrocket/orientation/contributors","subscribers_url":"https://api.github.com/repos/hashrocket/orientation/subscribers","subscription_url":"https://api.github.com/repos/hashrocket/orientation/subscription","commits_url":"https://api.github.com/repos/hashrocket/orientation/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashrocket/orientation/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashrocket/orientation/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashrocket/orientation/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashrocket/orientation/contents/{+path}","compare_url":"https://api.github.com/repos/hashrocket/orientation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashrocket/orientation/merges","archive_url":"https://api.github.com/repos/hashrocket/orientation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashrocket/orientation/downloads","issues_url":"https://api.github.com/repos/hashrocket/orientation/issues{/number}","pulls_url":"https://api.github.com/repos/hashrocket/orientation/pulls{/number}","milestones_url":"https://api.github.com/repos/hashrocket/orientation/milestones{/number}","notifications_url":"https://api.github.com/repos/hashrocket/orientation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashrocket/orientation/labels{/name}","releases_url":"https://api.github.com/repos/hashrocket/orientation/releases{/id}","created_at":"2015-09-02T19:21:39Z","updated_at":"2015-09-02T19:21:40Z","pushed_at":"2015-09-14T20:42:21Z","git_url":"git://github.com/hashrocket/orientation.git","ssh_url":"git@github.com:hashrocket/orientation.git","clone_url":"https://github.com/hashrocket/orientation.git","svn_url":"https://github.com/hashrocket/orientation","homepage":"","size":5597,"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":"orientation:master","ref":"master","sha":"fbc8aeedbac05866f072b679eee872ac6d7a923c","user":{"login":"orientation","id":11703432,"avatar_url":"https://avatars.githubusercontent.com/u/11703432?v=3","gravatar_id":"","url":"https://api.github.com/users/orientation","html_url":"https://github.com/orientation","followers_url":"https://api.github.com/users/orientation/followers","following_url":"https://api.github.com/users/orientation/following{/other_user}","gists_url":"https://api.github.com/users/orientation/gists{/gist_id}","starred_url":"https://api.github.com/users/orientation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orientation/subscriptions","organizations_url":"https://api.github.com/users/orientation/orgs","repos_url":"https://api.github.com/users/orientation/repos","events_url":"https://api.github.com/users/orientation/events{/privacy}","received_events_url":"https://api.github.com/users/orientation/received_events","type":"Organization","site_admin":false},"repo":{"id":6251961,"name":"orientation","full_name":"orientation/orientation","owner":{"login":"orientation","id":11703432,"avatar_url":"https://avatars.githubusercontent.com/u/11703432?v=3","gravatar_id":"","url":"https://api.github.com/users/orientation","html_url":"https://github.com/orientation","followers_url":"https://api.github.com/users/orientation/followers","following_url":"https://api.github.com/users/orientation/following{/other_user}","gists_url":"https://api.github.com/users/orientation/gists{/gist_id}","starred_url":"https://api.github.com/users/orientation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orientation/subscriptions","organizations_url":"https://api.github.com/users/orientation/orgs","repos_url":"https://api.github.com/users/orientation/repos","events_url":"https://api.github.com/users/orientation/events{/privacy}","received_events_url":"https://api.github.com/users/orientation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/orientation/orientation","description":"Fight information rot.","fork":false,"url":"https://api.github.com/repos/orientation/orientation","forks_url":"https://api.github.com/repos/orientation/orientation/forks","keys_url":"https://api.github.com/repos/orientation/orientation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/orientation/orientation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/orientation/orientation/teams","hooks_url":"https://api.github.com/repos/orientation/orientation/hooks","issue_events_url":"https://api.github.com/repos/orientation/orientation/issues/events{/number}","events_url":"https://api.github.com/repos/orientation/orientation/events","assignees_url":"https://api.github.com/repos/orientation/orientation/assignees{/user}","branches_url":"https://api.github.com/repos/orientation/orientation/branches{/branch}","tags_url":"https://api.github.com/repos/orientation/orientation/tags","blobs_url":"https://api.github.com/repos/orientation/orientation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/orientation/orientation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/orientation/orientation/git/refs{/sha}","trees_url":"https://api.github.com/repos/orientation/orientation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/orientation/orientation/statuses/{sha}","languages_url":"https://api.github.com/repos/orientation/orientation/languages","stargazers_url":"https://api.github.com/repos/orientation/orientation/stargazers","contributors_url":"https://api.github.com/repos/orientation/orientation/contributors","subscribers_url":"https://api.github.com/repos/orientation/orientation/subscribers","subscription_url":"https://api.github.com/repos/orientation/orientation/subscription","commits_url":"https://api.github.com/repos/orientation/orientation/commits{/sha}","git_commits_url":"https://api.github.com/repos/orientation/orientation/git/commits{/sha}","comments_url":"https://api.github.com/repos/orientation/orientation/comments{/number}","issue_comment_url":"https://api.github.com/repos/orientation/orientation/issues/comments{/number}","contents_url":"https://api.github.com/repos/orientation/orientation/contents/{+path}","compare_url":"https://api.github.com/repos/orientation/orientation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/orientation/orientation/merges","archive_url":"https://api.github.com/repos/orientation/orientation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/orientation/orientation/downloads","issues_url":"https://api.github.com/repos/orientation/orientation/issues{/number}","pulls_url":"https://api.github.com/repos/orientation/orientation/pulls{/number}","milestones_url":"https://api.github.com/repos/orientation/orientation/milestones{/number}","notifications_url":"https://api.github.com/repos/orientation/orientation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/orientation/orientation/labels{/name}","releases_url":"https://api.github.com/repos/orientation/orientation/releases{/id}","created_at":"2012-10-16T21:25:35Z","updated_at":"2015-09-14T19:13:00Z","pushed_at":"2015-09-14T20:53:48Z","git_url":"git://github.com/orientation/orientation.git","ssh_url":"git@github.com:orientation/orientation.git","clone_url":"https://github.com/orientation/orientation.git","svn_url":"https://github.com/orientation/orientation","homepage":"","size":7783,"stargazers_count":212,"watchers_count":212,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":29,"forks":45,"open_issues":29,"watchers":212,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/orientation/orientation/pulls/166"},"html":{"href":"https://github.com/orientation/orientation/pull/166"},"issue":{"href":"https://api.github.com/repos/orientation/orientation/issues/166"},"comments":{"href":"https://api.github.com/repos/orientation/orientation/issues/166/comments"},"review_comments":{"href":"https://api.github.com/repos/orientation/orientation/pulls/166/comments"},"review_comment":{"href":"https://api.github.com/repos/orientation/orientation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/orientation/orientation/pulls/166/commits"},"statuses":{"href":"https://api.github.com/repos/orientation/orientation/statuses/fa362283282240987f164999bfab79cb43a8fb06"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"olivierlacan","id":65950,"avatar_url":"https://avatars.githubusercontent.com/u/65950?v=3","gravatar_id":"","url":"https://api.github.com/users/olivierlacan","html_url":"https://github.com/olivierlacan","followers_url":"https://api.github.com/users/olivierlacan/followers","following_url":"https://api.github.com/users/olivierlacan/following{/other_user}","gists_url":"https://api.github.com/users/olivierlacan/gists{/gist_id}","starred_url":"https://api.github.com/users/olivierlacan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivierlacan/subscriptions","organizations_url":"https://api.github.com/users/olivierlacan/orgs","repos_url":"https://api.github.com/users/olivierlacan/repos","events_url":"https://api.github.com/users/olivierlacan/events{/privacy}","received_events_url":"https://api.github.com/users/olivierlacan/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":4,"deletions":5,"changed_files":2}}