{"action":"created","comment":{"url":"https://api.github.com/repos/local-ch/lhs/pulls/comments/64379241","id":64379241,"diff_hunk":"@@ -519,8 +551,7 @@ The kaminari’s page parameter is in params[:page]. For example, you can use ka\n params[:page] = 0 if params[:page].nil?\n page = params[:page].to_i\n limit = 100\n-offset = (page - 1) * limit\n-@items = Record.where({ limit: limit, offset: offset }))\n+@items = Record.page(page).per(limit)","path":"README.md","position":54,"original_position":54,"commit_id":"26924cc8607aeba3bb0b0b6c2e56d4db8307e5c6","original_commit_id":"26924cc8607aeba3bb0b0b6c2e56d4db8307e5c6","user":{"login":"pape-io","id":851393,"avatar_url":"https://avatars.githubusercontent.com/u/851393?v=3","gravatar_id":"","url":"https://api.github.com/users/pape-io","html_url":"https://github.com/pape-io","followers_url":"https://api.github.com/users/pape-io/followers","following_url":"https://api.github.com/users/pape-io/following{/other_user}","gists_url":"https://api.github.com/users/pape-io/gists{/gist_id}","starred_url":"https://api.github.com/users/pape-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pape-io/subscriptions","organizations_url":"https://api.github.com/users/pape-io/orgs","repos_url":"https://api.github.com/users/pape-io/repos","events_url":"https://api.github.com/users/pape-io/events{/privacy}","received_events_url":"https://api.github.com/users/pape-io/received_events","type":"User","site_admin":false},"body":"Will add a default of 1 for page :+1:","created_at":"2016-05-24T12:12:11Z","updated_at":"2016-05-24T12:12:11Z","html_url":"https://github.com/local-ch/lhs/pull/120#discussion_r64379241","pull_request_url":"https://api.github.com/repos/local-ch/lhs/pulls/120","_links":{"self":{"href":"https://api.github.com/repos/local-ch/lhs/pulls/comments/64379241"},"html":{"href":"https://github.com/local-ch/lhs/pull/120#discussion_r64379241"},"pull_request":{"href":"https://api.github.com/repos/local-ch/lhs/pulls/120"}}},"pull_request":{"url":"https://api.github.com/repos/local-ch/lhs/pulls/120","id":71168477,"html_url":"https://github.com/local-ch/lhs/pull/120","diff_url":"https://github.com/local-ch/lhs/pull/120.diff","patch_url":"https://github.com/local-ch/lhs/pull/120.patch","issue_url":"https://api.github.com/repos/local-ch/lhs/issues/120","number":120,"state":"open","locked":false,"title":"Pagination chains","user":{"login":"pape-io","id":851393,"avatar_url":"https://avatars.githubusercontent.com/u/851393?v=3","gravatar_id":"","url":"https://api.github.com/users/pape-io","html_url":"https://github.com/pape-io","followers_url":"https://api.github.com/users/pape-io/followers","following_url":"https://api.github.com/users/pape-io/following{/other_user}","gists_url":"https://api.github.com/users/pape-io/gists{/gist_id}","starred_url":"https://api.github.com/users/pape-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pape-io/subscriptions","organizations_url":"https://api.github.com/users/pape-io/orgs","repos_url":"https://api.github.com/users/pape-io/repos","events_url":"https://api.github.com/users/pape-io/events{/privacy}","received_events_url":"https://api.github.com/users/pape-io/received_events","type":"User","site_admin":false},"body":"### Pagination Chains\r\n\r\nYou can use chainable pagination in combination with query chains:\r\n\r\n```ruby\r\n  class Record < LHS::Record\r\n    endpoint 'http://local.ch/records'\r\n  end\r\n  Record.page(3).per(20).where(color: 'blue')\r\n  # http://local.ch/records?offset=60&limit=20\r\n```\r\n\r\nThe applied pagination strategy depends on the actual configured pagination, so the interface is the same for all strategies:\r\n\r\n```ruby\r\n  class Record < LHS::Record\r\n    endpoint 'http://local.ch/records'\r\n    configuration pagination_strategy: 'page'\r\n  end\r\n  Record.page(3).per(20).where(color: 'blue')\r\n  # http://local.ch/records?page=3&limit=20\r\n```\r\n\r\n```ruby\r\n  class Record < LHS::Record\r\n    endpoint 'http://local.ch/records'\r\n    configuration pagination_strategy: 'start'\r\n  end\r\n  Record.page(3).per(20).where(color: 'blue')\r\n  # http://local.ch/records?start=61&limit=20\r\n```","created_at":"2016-05-24T07:15:50Z","updated_at":"2016-05-24T12:12:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40c73faf36350857e677affec70e84e98a98911d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/local-ch/lhs/pulls/120/commits","review_comments_url":"https://api.github.com/repos/local-ch/lhs/pulls/120/comments","review_comment_url":"https://api.github.com/repos/local-ch/lhs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/local-ch/lhs/issues/120/comments","statuses_url":"https://api.github.com/repos/local-ch/lhs/statuses/26924cc8607aeba3bb0b0b6c2e56d4db8307e5c6","head":{"label":"local-ch:pagination-chains","ref":"pagination-chains","sha":"26924cc8607aeba3bb0b0b6c2e56d4db8307e5c6","user":{"login":"local-ch","id":474837,"avatar_url":"https://avatars.githubusercontent.com/u/474837?v=3","gravatar_id":"","url":"https://api.github.com/users/local-ch","html_url":"https://github.com/local-ch","followers_url":"https://api.github.com/users/local-ch/followers","following_url":"https://api.github.com/users/local-ch/following{/other_user}","gists_url":"https://api.github.com/users/local-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/local-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/local-ch/subscriptions","organizations_url":"https://api.github.com/users/local-ch/orgs","repos_url":"https://api.github.com/users/local-ch/repos","events_url":"https://api.github.com/users/local-ch/events{/privacy}","received_events_url":"https://api.github.com/users/local-ch/received_events","type":"Organization","site_admin":false},"repo":{"id":24098393,"name":"lhs","full_name":"local-ch/lhs","owner":{"login":"local-ch","id":474837,"avatar_url":"https://avatars.githubusercontent.com/u/474837?v=3","gravatar_id":"","url":"https://api.github.com/users/local-ch","html_url":"https://github.com/local-ch","followers_url":"https://api.github.com/users/local-ch/followers","following_url":"https://api.github.com/users/local-ch/following{/other_user}","gists_url":"https://api.github.com/users/local-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/local-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/local-ch/subscriptions","organizations_url":"https://api.github.com/users/local-ch/orgs","repos_url":"https://api.github.com/users/local-ch/repos","events_url":"https://api.github.com/users/local-ch/events{/privacy}","received_events_url":"https://api.github.com/users/local-ch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/local-ch/lhs","description":"Rails gem providing an easy, active-record-like interface for http json services","fork":false,"url":"https://api.github.com/repos/local-ch/lhs","forks_url":"https://api.github.com/repos/local-ch/lhs/forks","keys_url":"https://api.github.com/repos/local-ch/lhs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/local-ch/lhs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/local-ch/lhs/teams","hooks_url":"https://api.github.com/repos/local-ch/lhs/hooks","issue_events_url":"https://api.github.com/repos/local-ch/lhs/issues/events{/number}","events_url":"https://api.github.com/repos/local-ch/lhs/events","assignees_url":"https://api.github.com/repos/local-ch/lhs/assignees{/user}","branches_url":"https://api.github.com/repos/local-ch/lhs/branches{/branch}","tags_url":"https://api.github.com/repos/local-ch/lhs/tags","blobs_url":"https://api.github.com/repos/local-ch/lhs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/local-ch/lhs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/local-ch/lhs/git/refs{/sha}","trees_url":"https://api.github.com/repos/local-ch/lhs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/local-ch/lhs/statuses/{sha}","languages_url":"https://api.github.com/repos/local-ch/lhs/languages","stargazers_url":"https://api.github.com/repos/local-ch/lhs/stargazers","contributors_url":"https://api.github.com/repos/local-ch/lhs/contributors","subscribers_url":"https://api.github.com/repos/local-ch/lhs/subscribers","subscription_url":"https://api.github.com/repos/local-ch/lhs/subscription","commits_url":"https://api.github.com/repos/local-ch/lhs/commits{/sha}","git_commits_url":"https://api.github.com/repos/local-ch/lhs/git/commits{/sha}","comments_url":"https://api.github.com/repos/local-ch/lhs/comments{/number}","issue_comment_url":"https://api.github.com/repos/local-ch/lhs/issues/comments{/number}","contents_url":"https://api.github.com/repos/local-ch/lhs/contents/{+path}","compare_url":"https://api.github.com/repos/local-ch/lhs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/local-ch/lhs/merges","archive_url":"https://api.github.com/repos/local-ch/lhs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/local-ch/lhs/downloads","issues_url":"https://api.github.com/repos/local-ch/lhs/issues{/number}","pulls_url":"https://api.github.com/repos/local-ch/lhs/pulls{/number}","milestones_url":"https://api.github.com/repos/local-ch/lhs/milestones{/number}","notifications_url":"https://api.github.com/repos/local-ch/lhs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/local-ch/lhs/labels{/name}","releases_url":"https://api.github.com/repos/local-ch/lhs/releases{/id}","deployments_url":"https://api.github.com/repos/local-ch/lhs/deployments","created_at":"2014-09-16T12:25:31Z","updated_at":"2016-04-22T19:41:19Z","pushed_at":"2016-05-24T11:39:01Z","git_url":"git://github.com/local-ch/lhs.git","ssh_url":"git@github.com:local-ch/lhs.git","clone_url":"https://github.com/local-ch/lhs.git","svn_url":"https://github.com/local-ch/lhs","homepage":"","size":998,"stargazers_count":47,"watchers_count":47,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":47,"default_branch":"master"}},"base":{"label":"local-ch:master","ref":"master","sha":"c1571bc49580217cef3a5922e3d2c06b47494966","user":{"login":"local-ch","id":474837,"avatar_url":"https://avatars.githubusercontent.com/u/474837?v=3","gravatar_id":"","url":"https://api.github.com/users/local-ch","html_url":"https://github.com/local-ch","followers_url":"https://api.github.com/users/local-ch/followers","following_url":"https://api.github.com/users/local-ch/following{/other_user}","gists_url":"https://api.github.com/users/local-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/local-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/local-ch/subscriptions","organizations_url":"https://api.github.com/users/local-ch/orgs","repos_url":"https://api.github.com/users/local-ch/repos","events_url":"https://api.github.com/users/local-ch/events{/privacy}","received_events_url":"https://api.github.com/users/local-ch/received_events","type":"Organization","site_admin":false},"repo":{"id":24098393,"name":"lhs","full_name":"local-ch/lhs","owner":{"login":"local-ch","id":474837,"avatar_url":"https://avatars.githubusercontent.com/u/474837?v=3","gravatar_id":"","url":"https://api.github.com/users/local-ch","html_url":"https://github.com/local-ch","followers_url":"https://api.github.com/users/local-ch/followers","following_url":"https://api.github.com/users/local-ch/following{/other_user}","gists_url":"https://api.github.com/users/local-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/local-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/local-ch/subscriptions","organizations_url":"https://api.github.com/users/local-ch/orgs","repos_url":"https://api.github.com/users/local-ch/repos","events_url":"https://api.github.com/users/local-ch/events{/privacy}","received_events_url":"https://api.github.com/users/local-ch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/local-ch/lhs","description":"Rails gem providing an easy, active-record-like interface for http json services","fork":false,"url":"https://api.github.com/repos/local-ch/lhs","forks_url":"https://api.github.com/repos/local-ch/lhs/forks","keys_url":"https://api.github.com/repos/local-ch/lhs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/local-ch/lhs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/local-ch/lhs/teams","hooks_url":"https://api.github.com/repos/local-ch/lhs/hooks","issue_events_url":"https://api.github.com/repos/local-ch/lhs/issues/events{/number}","events_url":"https://api.github.com/repos/local-ch/lhs/events","assignees_url":"https://api.github.com/repos/local-ch/lhs/assignees{/user}","branches_url":"https://api.github.com/repos/local-ch/lhs/branches{/branch}","tags_url":"https://api.github.com/repos/local-ch/lhs/tags","blobs_url":"https://api.github.com/repos/local-ch/lhs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/local-ch/lhs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/local-ch/lhs/git/refs{/sha}","trees_url":"https://api.github.com/repos/local-ch/lhs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/local-ch/lhs/statuses/{sha}","languages_url":"https://api.github.com/repos/local-ch/lhs/languages","stargazers_url":"https://api.github.com/repos/local-ch/lhs/stargazers","contributors_url":"https://api.github.com/repos/local-ch/lhs/contributors","subscribers_url":"https://api.github.com/repos/local-ch/lhs/subscribers","subscription_url":"https://api.github.com/repos/local-ch/lhs/subscription","commits_url":"https://api.github.com/repos/local-ch/lhs/commits{/sha}","git_commits_url":"https://api.github.com/repos/local-ch/lhs/git/commits{/sha}","comments_url":"https://api.github.com/repos/local-ch/lhs/comments{/number}","issue_comment_url":"https://api.github.com/repos/local-ch/lhs/issues/comments{/number}","contents_url":"https://api.github.com/repos/local-ch/lhs/contents/{+path}","compare_url":"https://api.github.com/repos/local-ch/lhs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/local-ch/lhs/merges","archive_url":"https://api.github.com/repos/local-ch/lhs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/local-ch/lhs/downloads","issues_url":"https://api.github.com/repos/local-ch/lhs/issues{/number}","pulls_url":"https://api.github.com/repos/local-ch/lhs/pulls{/number}","milestones_url":"https://api.github.com/repos/local-ch/lhs/milestones{/number}","notifications_url":"https://api.github.com/repos/local-ch/lhs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/local-ch/lhs/labels{/name}","releases_url":"https://api.github.com/repos/local-ch/lhs/releases{/id}","deployments_url":"https://api.github.com/repos/local-ch/lhs/deployments","created_at":"2014-09-16T12:25:31Z","updated_at":"2016-04-22T19:41:19Z","pushed_at":"2016-05-24T11:39:01Z","git_url":"git://github.com/local-ch/lhs.git","ssh_url":"git@github.com:local-ch/lhs.git","clone_url":"https://github.com/local-ch/lhs.git","svn_url":"https://github.com/local-ch/lhs","homepage":"","size":998,"stargazers_count":47,"watchers_count":47,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":47,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/local-ch/lhs/pulls/120"},"html":{"href":"https://github.com/local-ch/lhs/pull/120"},"issue":{"href":"https://api.github.com/repos/local-ch/lhs/issues/120"},"comments":{"href":"https://api.github.com/repos/local-ch/lhs/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/local-ch/lhs/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/local-ch/lhs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/local-ch/lhs/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/local-ch/lhs/statuses/26924cc8607aeba3bb0b0b6c2e56d4db8307e5c6"}}}}
{"actor":{"display_login":"pape-io"}}