{"action":"opened","number":5,"pull_request":{"url":"https://api.github.com/repos/dblock/mongoid-scroll/pulls/5","id":40810579,"html_url":"https://github.com/dblock/mongoid-scroll/pull/5","diff_url":"https://github.com/dblock/mongoid-scroll/pull/5.diff","patch_url":"https://github.com/dblock/mongoid-scroll/pull/5.patch","issue_url":"https://api.github.com/repos/dblock/mongoid-scroll/issues/5","number":5,"state":"open","locked":false,"title":"(Fix) Duplicate criteria instead of constructing from scratch","user":{"login":"sweir27","id":2081340,"avatar_url":"https://avatars.githubusercontent.com/u/2081340?v=3","gravatar_id":"","url":"https://api.github.com/users/sweir27","html_url":"https://github.com/sweir27","followers_url":"https://api.github.com/users/sweir27/followers","following_url":"https://api.github.com/users/sweir27/following{/other_user}","gists_url":"https://api.github.com/users/sweir27/gists{/gist_id}","starred_url":"https://api.github.com/users/sweir27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sweir27/subscriptions","organizations_url":"https://api.github.com/users/sweir27/orgs","repos_url":"https://api.github.com/users/sweir27/repos","events_url":"https://api.github.com/users/sweir27/events{/privacy}","received_events_url":"https://api.github.com/users/sweir27/received_events","type":"User","site_admin":false},"body":"Amazingly, this seems slightly less hacky then before.\r\n\r\nWe encountered a bug whereby embedded items were not returned in pagination. Turns out this is because when we were constructing the mongoid criteria from scratch (to correctly chain together queries), all parent associations on the criteria were not maintained, including the parent collection for an embedded object.\r\n\r\nThis PR first duplicates the original criteria, and then only changes the selector (that's all we want to modify anyways). It's cleaner because by calling `criteria.dup` we don't have to individually build each necessary attribute of the criteria.","created_at":"2015-07-24T20:04:51Z","updated_at":"2015-07-24T20:04:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dblock/mongoid-scroll/pulls/5/commits","review_comments_url":"https://api.github.com/repos/dblock/mongoid-scroll/pulls/5/comments","review_comment_url":"https://api.github.com/repos/dblock/mongoid-scroll/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dblock/mongoid-scroll/issues/5/comments","statuses_url":"https://api.github.com/repos/dblock/mongoid-scroll/statuses/b198faee83bf2647b46638165c59b2bbc7d206b6","head":{"label":"sweir27:dont-ignore-embeddable","ref":"dont-ignore-embeddable","sha":"b198faee83bf2647b46638165c59b2bbc7d206b6","user":{"login":"sweir27","id":2081340,"avatar_url":"https://avatars.githubusercontent.com/u/2081340?v=3","gravatar_id":"","url":"https://api.github.com/users/sweir27","html_url":"https://github.com/sweir27","followers_url":"https://api.github.com/users/sweir27/followers","following_url":"https://api.github.com/users/sweir27/following{/other_user}","gists_url":"https://api.github.com/users/sweir27/gists{/gist_id}","starred_url":"https://api.github.com/users/sweir27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sweir27/subscriptions","organizations_url":"https://api.github.com/users/sweir27/orgs","repos_url":"https://api.github.com/users/sweir27/repos","events_url":"https://api.github.com/users/sweir27/events{/privacy}","received_events_url":"https://api.github.com/users/sweir27/received_events","type":"User","site_admin":false},"repo":{"id":39513880,"name":"mongoid-scroll","full_name":"sweir27/mongoid-scroll","owner":{"login":"sweir27","id":2081340,"avatar_url":"https://avatars.githubusercontent.com/u/2081340?v=3","gravatar_id":"","url":"https://api.github.com/users/sweir27","html_url":"https://github.com/sweir27","followers_url":"https://api.github.com/users/sweir27/followers","following_url":"https://api.github.com/users/sweir27/following{/other_user}","gists_url":"https://api.github.com/users/sweir27/gists{/gist_id}","starred_url":"https://api.github.com/users/sweir27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sweir27/subscriptions","organizations_url":"https://api.github.com/users/sweir27/orgs","repos_url":"https://api.github.com/users/sweir27/repos","events_url":"https://api.github.com/users/sweir27/events{/privacy}","received_events_url":"https://api.github.com/users/sweir27/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sweir27/mongoid-scroll","description":"Mongoid extension that enables infinite scrolling with MongoDB.","fork":true,"url":"https://api.github.com/repos/sweir27/mongoid-scroll","forks_url":"https://api.github.com/repos/sweir27/mongoid-scroll/forks","keys_url":"https://api.github.com/repos/sweir27/mongoid-scroll/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sweir27/mongoid-scroll/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sweir27/mongoid-scroll/teams","hooks_url":"https://api.github.com/repos/sweir27/mongoid-scroll/hooks","issue_events_url":"https://api.github.com/repos/sweir27/mongoid-scroll/issues/events{/number}","events_url":"https://api.github.com/repos/sweir27/mongoid-scroll/events","assignees_url":"https://api.github.com/repos/sweir27/mongoid-scroll/assignees{/user}","branches_url":"https://api.github.com/repos/sweir27/mongoid-scroll/branches{/branch}","tags_url":"https://api.github.com/repos/sweir27/mongoid-scroll/tags","blobs_url":"https://api.github.com/repos/sweir27/mongoid-scroll/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sweir27/mongoid-scroll/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sweir27/mongoid-scroll/git/refs{/sha}","trees_url":"https://api.github.com/repos/sweir27/mongoid-scroll/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sweir27/mongoid-scroll/statuses/{sha}","languages_url":"https://api.github.com/repos/sweir27/mongoid-scroll/languages","stargazers_url":"https://api.github.com/repos/sweir27/mongoid-scroll/stargazers","contributors_url":"https://api.github.com/repos/sweir27/mongoid-scroll/contributors","subscribers_url":"https://api.github.com/repos/sweir27/mongoid-scroll/subscribers","subscription_url":"https://api.github.com/repos/sweir27/mongoid-scroll/subscription","commits_url":"https://api.github.com/repos/sweir27/mongoid-scroll/commits{/sha}","git_commits_url":"https://api.github.com/repos/sweir27/mongoid-scroll/git/commits{/sha}","comments_url":"https://api.github.com/repos/sweir27/mongoid-scroll/comments{/number}","issue_comment_url":"https://api.github.com/repos/sweir27/mongoid-scroll/issues/comments{/number}","contents_url":"https://api.github.com/repos/sweir27/mongoid-scroll/contents/{+path}","compare_url":"https://api.github.com/repos/sweir27/mongoid-scroll/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sweir27/mongoid-scroll/merges","archive_url":"https://api.github.com/repos/sweir27/mongoid-scroll/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sweir27/mongoid-scroll/downloads","issues_url":"https://api.github.com/repos/sweir27/mongoid-scroll/issues{/number}","pulls_url":"https://api.github.com/repos/sweir27/mongoid-scroll/pulls{/number}","milestones_url":"https://api.github.com/repos/sweir27/mongoid-scroll/milestones{/number}","notifications_url":"https://api.github.com/repos/sweir27/mongoid-scroll/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sweir27/mongoid-scroll/labels{/name}","releases_url":"https://api.github.com/repos/sweir27/mongoid-scroll/releases{/id}","created_at":"2015-07-22T15:25:28Z","updated_at":"2015-07-22T15:25:28Z","pushed_at":"2015-07-24T20:00:48Z","git_url":"git://github.com/sweir27/mongoid-scroll.git","ssh_url":"git@github.com:sweir27/mongoid-scroll.git","clone_url":"https://github.com/sweir27/mongoid-scroll.git","svn_url":"https://github.com/sweir27/mongoid-scroll","homepage":"","size":127,"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":"dblock:master","ref":"master","sha":"bdca40018db5395e7da8428835a9c7f00b50008c","user":{"login":"dblock","id":542335,"avatar_url":"https://avatars.githubusercontent.com/u/542335?v=3","gravatar_id":"","url":"https://api.github.com/users/dblock","html_url":"https://github.com/dblock","followers_url":"https://api.github.com/users/dblock/followers","following_url":"https://api.github.com/users/dblock/following{/other_user}","gists_url":"https://api.github.com/users/dblock/gists{/gist_id}","starred_url":"https://api.github.com/users/dblock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblock/subscriptions","organizations_url":"https://api.github.com/users/dblock/orgs","repos_url":"https://api.github.com/users/dblock/repos","events_url":"https://api.github.com/users/dblock/events{/privacy}","received_events_url":"https://api.github.com/users/dblock/received_events","type":"User","site_admin":false},"repo":{"id":8205116,"name":"mongoid-scroll","full_name":"dblock/mongoid-scroll","owner":{"login":"dblock","id":542335,"avatar_url":"https://avatars.githubusercontent.com/u/542335?v=3","gravatar_id":"","url":"https://api.github.com/users/dblock","html_url":"https://github.com/dblock","followers_url":"https://api.github.com/users/dblock/followers","following_url":"https://api.github.com/users/dblock/following{/other_user}","gists_url":"https://api.github.com/users/dblock/gists{/gist_id}","starred_url":"https://api.github.com/users/dblock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblock/subscriptions","organizations_url":"https://api.github.com/users/dblock/orgs","repos_url":"https://api.github.com/users/dblock/repos","events_url":"https://api.github.com/users/dblock/events{/privacy}","received_events_url":"https://api.github.com/users/dblock/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dblock/mongoid-scroll","description":"Mongoid extension that enables infinite scrolling with MongoDB.","fork":false,"url":"https://api.github.com/repos/dblock/mongoid-scroll","forks_url":"https://api.github.com/repos/dblock/mongoid-scroll/forks","keys_url":"https://api.github.com/repos/dblock/mongoid-scroll/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dblock/mongoid-scroll/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dblock/mongoid-scroll/teams","hooks_url":"https://api.github.com/repos/dblock/mongoid-scroll/hooks","issue_events_url":"https://api.github.com/repos/dblock/mongoid-scroll/issues/events{/number}","events_url":"https://api.github.com/repos/dblock/mongoid-scroll/events","assignees_url":"https://api.github.com/repos/dblock/mongoid-scroll/assignees{/user}","branches_url":"https://api.github.com/repos/dblock/mongoid-scroll/branches{/branch}","tags_url":"https://api.github.com/repos/dblock/mongoid-scroll/tags","blobs_url":"https://api.github.com/repos/dblock/mongoid-scroll/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dblock/mongoid-scroll/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dblock/mongoid-scroll/git/refs{/sha}","trees_url":"https://api.github.com/repos/dblock/mongoid-scroll/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dblock/mongoid-scroll/statuses/{sha}","languages_url":"https://api.github.com/repos/dblock/mongoid-scroll/languages","stargazers_url":"https://api.github.com/repos/dblock/mongoid-scroll/stargazers","contributors_url":"https://api.github.com/repos/dblock/mongoid-scroll/contributors","subscribers_url":"https://api.github.com/repos/dblock/mongoid-scroll/subscribers","subscription_url":"https://api.github.com/repos/dblock/mongoid-scroll/subscription","commits_url":"https://api.github.com/repos/dblock/mongoid-scroll/commits{/sha}","git_commits_url":"https://api.github.com/repos/dblock/mongoid-scroll/git/commits{/sha}","comments_url":"https://api.github.com/repos/dblock/mongoid-scroll/comments{/number}","issue_comment_url":"https://api.github.com/repos/dblock/mongoid-scroll/issues/comments{/number}","contents_url":"https://api.github.com/repos/dblock/mongoid-scroll/contents/{+path}","compare_url":"https://api.github.com/repos/dblock/mongoid-scroll/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dblock/mongoid-scroll/merges","archive_url":"https://api.github.com/repos/dblock/mongoid-scroll/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dblock/mongoid-scroll/downloads","issues_url":"https://api.github.com/repos/dblock/mongoid-scroll/issues{/number}","pulls_url":"https://api.github.com/repos/dblock/mongoid-scroll/pulls{/number}","milestones_url":"https://api.github.com/repos/dblock/mongoid-scroll/milestones{/number}","notifications_url":"https://api.github.com/repos/dblock/mongoid-scroll/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dblock/mongoid-scroll/labels{/name}","releases_url":"https://api.github.com/repos/dblock/mongoid-scroll/releases{/id}","created_at":"2013-02-14T18:34:04Z","updated_at":"2015-04-27T16:00:16Z","pushed_at":"2015-07-24T20:04:51Z","git_url":"git://github.com/dblock/mongoid-scroll.git","ssh_url":"git@github.com:dblock/mongoid-scroll.git","clone_url":"https://github.com/dblock/mongoid-scroll.git","svn_url":"https://github.com/dblock/mongoid-scroll","homepage":"","size":333,"stargazers_count":39,"watchers_count":39,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dblock/mongoid-scroll/pulls/5"},"html":{"href":"https://github.com/dblock/mongoid-scroll/pull/5"},"issue":{"href":"https://api.github.com/repos/dblock/mongoid-scroll/issues/5"},"comments":{"href":"https://api.github.com/repos/dblock/mongoid-scroll/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/dblock/mongoid-scroll/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/dblock/mongoid-scroll/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dblock/mongoid-scroll/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/dblock/mongoid-scroll/statuses/b198faee83bf2647b46638165c59b2bbc7d206b6"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":31,"deletions":3,"changed_files":5}}