{"action":"opened","number":707,"pull_request":{"url":"https://api.github.com/repos/amatsuda/kaminari/pulls/707","id":38545538,"html_url":"https://github.com/amatsuda/kaminari/pull/707","diff_url":"https://github.com/amatsuda/kaminari/pull/707.diff","patch_url":"https://github.com/amatsuda/kaminari/pull/707.patch","issue_url":"https://api.github.com/repos/amatsuda/kaminari/issues/707","number":707,"state":"open","locked":false,"title":"Add possibility to set `total_count` for a scope","user":{"login":"mrhead","id":522375,"avatar_url":"https://avatars.githubusercontent.com/u/522375?v=3","gravatar_id":"","url":"https://api.github.com/users/mrhead","html_url":"https://github.com/mrhead","followers_url":"https://api.github.com/users/mrhead/followers","following_url":"https://api.github.com/users/mrhead/following{/other_user}","gists_url":"https://api.github.com/users/mrhead/gists{/gist_id}","starred_url":"https://api.github.com/users/mrhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrhead/subscriptions","organizations_url":"https://api.github.com/users/mrhead/orgs","repos_url":"https://api.github.com/users/mrhead/repos","events_url":"https://api.github.com/users/mrhead/events{/privacy}","received_events_url":"https://api.github.com/users/mrhead/received_events","type":"User","site_admin":false},"body":"Counting can be slow with large DB sets. Especially in PostgreSQL, because it returns a precise result and therefore it needs to read all the resulting rows to verify that they exists.\r\n\r\nBut sometimes it is better to have a fast but not so precise result. In that case we can tell `kaminari` what the approximate total count is, so it doesn't need to calculate it with SQL `count`.","created_at":"2015-06-25T13:14:09Z","updated_at":"2015-06-25T13:14:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amatsuda/kaminari/pulls/707/commits","review_comments_url":"https://api.github.com/repos/amatsuda/kaminari/pulls/707/comments","review_comment_url":"https://api.github.com/repos/amatsuda/kaminari/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amatsuda/kaminari/issues/707/comments","statuses_url":"https://api.github.com/repos/amatsuda/kaminari/statuses/7630b2a5d1a5bebd3610d2c0495b5ec3e1409cce","head":{"label":"mrhead:pb/set_total_count","ref":"pb/set_total_count","sha":"7630b2a5d1a5bebd3610d2c0495b5ec3e1409cce","user":{"login":"mrhead","id":522375,"avatar_url":"https://avatars.githubusercontent.com/u/522375?v=3","gravatar_id":"","url":"https://api.github.com/users/mrhead","html_url":"https://github.com/mrhead","followers_url":"https://api.github.com/users/mrhead/followers","following_url":"https://api.github.com/users/mrhead/following{/other_user}","gists_url":"https://api.github.com/users/mrhead/gists{/gist_id}","starred_url":"https://api.github.com/users/mrhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrhead/subscriptions","organizations_url":"https://api.github.com/users/mrhead/orgs","repos_url":"https://api.github.com/users/mrhead/repos","events_url":"https://api.github.com/users/mrhead/events{/privacy}","received_events_url":"https://api.github.com/users/mrhead/received_events","type":"User","site_admin":false},"repo":{"id":38049413,"name":"kaminari","full_name":"mrhead/kaminari","owner":{"login":"mrhead","id":522375,"avatar_url":"https://avatars.githubusercontent.com/u/522375?v=3","gravatar_id":"","url":"https://api.github.com/users/mrhead","html_url":"https://github.com/mrhead","followers_url":"https://api.github.com/users/mrhead/followers","following_url":"https://api.github.com/users/mrhead/following{/other_user}","gists_url":"https://api.github.com/users/mrhead/gists{/gist_id}","starred_url":"https://api.github.com/users/mrhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrhead/subscriptions","organizations_url":"https://api.github.com/users/mrhead/orgs","repos_url":"https://api.github.com/users/mrhead/repos","events_url":"https://api.github.com/users/mrhead/events{/privacy}","received_events_url":"https://api.github.com/users/mrhead/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrhead/kaminari","description":"A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for Rails 3 and 4","fork":true,"url":"https://api.github.com/repos/mrhead/kaminari","forks_url":"https://api.github.com/repos/mrhead/kaminari/forks","keys_url":"https://api.github.com/repos/mrhead/kaminari/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrhead/kaminari/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrhead/kaminari/teams","hooks_url":"https://api.github.com/repos/mrhead/kaminari/hooks","issue_events_url":"https://api.github.com/repos/mrhead/kaminari/issues/events{/number}","events_url":"https://api.github.com/repos/mrhead/kaminari/events","assignees_url":"https://api.github.com/repos/mrhead/kaminari/assignees{/user}","branches_url":"https://api.github.com/repos/mrhead/kaminari/branches{/branch}","tags_url":"https://api.github.com/repos/mrhead/kaminari/tags","blobs_url":"https://api.github.com/repos/mrhead/kaminari/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrhead/kaminari/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrhead/kaminari/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrhead/kaminari/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrhead/kaminari/statuses/{sha}","languages_url":"https://api.github.com/repos/mrhead/kaminari/languages","stargazers_url":"https://api.github.com/repos/mrhead/kaminari/stargazers","contributors_url":"https://api.github.com/repos/mrhead/kaminari/contributors","subscribers_url":"https://api.github.com/repos/mrhead/kaminari/subscribers","subscription_url":"https://api.github.com/repos/mrhead/kaminari/subscription","commits_url":"https://api.github.com/repos/mrhead/kaminari/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrhead/kaminari/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrhead/kaminari/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrhead/kaminari/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrhead/kaminari/contents/{+path}","compare_url":"https://api.github.com/repos/mrhead/kaminari/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrhead/kaminari/merges","archive_url":"https://api.github.com/repos/mrhead/kaminari/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrhead/kaminari/downloads","issues_url":"https://api.github.com/repos/mrhead/kaminari/issues{/number}","pulls_url":"https://api.github.com/repos/mrhead/kaminari/pulls{/number}","milestones_url":"https://api.github.com/repos/mrhead/kaminari/milestones{/number}","notifications_url":"https://api.github.com/repos/mrhead/kaminari/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrhead/kaminari/labels{/name}","releases_url":"https://api.github.com/repos/mrhead/kaminari/releases{/id}","created_at":"2015-06-25T13:00:25Z","updated_at":"2015-06-25T13:00:26Z","pushed_at":"2015-06-25T13:12:17Z","git_url":"git://github.com/mrhead/kaminari.git","ssh_url":"git@github.com:mrhead/kaminari.git","clone_url":"https://github.com/mrhead/kaminari.git","svn_url":"https://github.com/mrhead/kaminari","homepage":"https://github.com/amatsuda/kaminari/wiki","size":3171,"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":"amatsuda:master","ref":"master","sha":"61e387251bf37527b26b6554a96e66914fef72af","user":{"login":"amatsuda","id":11493,"avatar_url":"https://avatars.githubusercontent.com/u/11493?v=3","gravatar_id":"","url":"https://api.github.com/users/amatsuda","html_url":"https://github.com/amatsuda","followers_url":"https://api.github.com/users/amatsuda/followers","following_url":"https://api.github.com/users/amatsuda/following{/other_user}","gists_url":"https://api.github.com/users/amatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/amatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amatsuda/subscriptions","organizations_url":"https://api.github.com/users/amatsuda/orgs","repos_url":"https://api.github.com/users/amatsuda/repos","events_url":"https://api.github.com/users/amatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/amatsuda/received_events","type":"User","site_admin":false},"repo":{"id":1333863,"name":"kaminari","full_name":"amatsuda/kaminari","owner":{"login":"amatsuda","id":11493,"avatar_url":"https://avatars.githubusercontent.com/u/11493?v=3","gravatar_id":"","url":"https://api.github.com/users/amatsuda","html_url":"https://github.com/amatsuda","followers_url":"https://api.github.com/users/amatsuda/followers","following_url":"https://api.github.com/users/amatsuda/following{/other_user}","gists_url":"https://api.github.com/users/amatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/amatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amatsuda/subscriptions","organizations_url":"https://api.github.com/users/amatsuda/orgs","repos_url":"https://api.github.com/users/amatsuda/repos","events_url":"https://api.github.com/users/amatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/amatsuda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amatsuda/kaminari","description":"A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for Rails 3 and 4","fork":false,"url":"https://api.github.com/repos/amatsuda/kaminari","forks_url":"https://api.github.com/repos/amatsuda/kaminari/forks","keys_url":"https://api.github.com/repos/amatsuda/kaminari/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amatsuda/kaminari/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amatsuda/kaminari/teams","hooks_url":"https://api.github.com/repos/amatsuda/kaminari/hooks","issue_events_url":"https://api.github.com/repos/amatsuda/kaminari/issues/events{/number}","events_url":"https://api.github.com/repos/amatsuda/kaminari/events","assignees_url":"https://api.github.com/repos/amatsuda/kaminari/assignees{/user}","branches_url":"https://api.github.com/repos/amatsuda/kaminari/branches{/branch}","tags_url":"https://api.github.com/repos/amatsuda/kaminari/tags","blobs_url":"https://api.github.com/repos/amatsuda/kaminari/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amatsuda/kaminari/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amatsuda/kaminari/git/refs{/sha}","trees_url":"https://api.github.com/repos/amatsuda/kaminari/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amatsuda/kaminari/statuses/{sha}","languages_url":"https://api.github.com/repos/amatsuda/kaminari/languages","stargazers_url":"https://api.github.com/repos/amatsuda/kaminari/stargazers","contributors_url":"https://api.github.com/repos/amatsuda/kaminari/contributors","subscribers_url":"https://api.github.com/repos/amatsuda/kaminari/subscribers","subscription_url":"https://api.github.com/repos/amatsuda/kaminari/subscription","commits_url":"https://api.github.com/repos/amatsuda/kaminari/commits{/sha}","git_commits_url":"https://api.github.com/repos/amatsuda/kaminari/git/commits{/sha}","comments_url":"https://api.github.com/repos/amatsuda/kaminari/comments{/number}","issue_comment_url":"https://api.github.com/repos/amatsuda/kaminari/issues/comments{/number}","contents_url":"https://api.github.com/repos/amatsuda/kaminari/contents/{+path}","compare_url":"https://api.github.com/repos/amatsuda/kaminari/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amatsuda/kaminari/merges","archive_url":"https://api.github.com/repos/amatsuda/kaminari/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amatsuda/kaminari/downloads","issues_url":"https://api.github.com/repos/amatsuda/kaminari/issues{/number}","pulls_url":"https://api.github.com/repos/amatsuda/kaminari/pulls{/number}","milestones_url":"https://api.github.com/repos/amatsuda/kaminari/milestones{/number}","notifications_url":"https://api.github.com/repos/amatsuda/kaminari/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amatsuda/kaminari/labels{/name}","releases_url":"https://api.github.com/repos/amatsuda/kaminari/releases{/id}","created_at":"2011-02-06T08:07:20Z","updated_at":"2015-06-23T18:45:21Z","pushed_at":"2015-06-25T08:58:07Z","git_url":"git://github.com/amatsuda/kaminari.git","ssh_url":"git@github.com:amatsuda/kaminari.git","clone_url":"https://github.com/amatsuda/kaminari.git","svn_url":"https://github.com/amatsuda/kaminari","homepage":"https://github.com/amatsuda/kaminari/wiki","size":3171,"stargazers_count":5031,"watchers_count":5031,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":681,"mirror_url":null,"open_issues_count":25,"forks":681,"open_issues":25,"watchers":5031,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amatsuda/kaminari/pulls/707"},"html":{"href":"https://github.com/amatsuda/kaminari/pull/707"},"issue":{"href":"https://api.github.com/repos/amatsuda/kaminari/issues/707"},"comments":{"href":"https://api.github.com/repos/amatsuda/kaminari/issues/707/comments"},"review_comments":{"href":"https://api.github.com/repos/amatsuda/kaminari/pulls/707/comments"},"review_comment":{"href":"https://api.github.com/repos/amatsuda/kaminari/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amatsuda/kaminari/pulls/707/commits"},"statuses":{"href":"https://api.github.com/repos/amatsuda/kaminari/statuses/7630b2a5d1a5bebd3610d2c0495b5ec3e1409cce"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":10,"deletions":0,"changed_files":2}}