{"action":"created","issue":{"url":"https://api.github.com/repos/mongoid/mongoid/issues/3935","labels_url":"https://api.github.com/repos/mongoid/mongoid/issues/3935/labels{/name}","comments_url":"https://api.github.com/repos/mongoid/mongoid/issues/3935/comments","events_url":"https://api.github.com/repos/mongoid/mongoid/issues/3935/events","html_url":"https://github.com/mongoid/mongoid/pull/3935","id":56156567,"number":3935,"title":"fix contextual memory multi field sort spec","user":{"login":"chamnap","id":407708,"avatar_url":"https://avatars.githubusercontent.com/u/407708?v=3","gravatar_id":"","url":"https://api.github.com/users/chamnap","html_url":"https://github.com/chamnap","followers_url":"https://api.github.com/users/chamnap/followers","following_url":"https://api.github.com/users/chamnap/following{/other_user}","gists_url":"https://api.github.com/users/chamnap/gists{/gist_id}","starred_url":"https://api.github.com/users/chamnap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamnap/subscriptions","organizations_url":"https://api.github.com/users/chamnap/orgs","repos_url":"https://api.github.com/users/chamnap/repos","events_url":"https://api.github.com/users/chamnap/events{/privacy}","received_events_url":"https://api.github.com/users/chamnap/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-01T08:19:48Z","updated_at":"2015-02-05T16:00:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mongoid/mongoid/pulls/3935","html_url":"https://github.com/mongoid/mongoid/pull/3935","diff_url":"https://github.com/mongoid/mongoid/pull/3935.diff","patch_url":"https://github.com/mongoid/mongoid/pull/3935.patch"},"body":"There is a bug on contextual memory when sorting multiple fields as mentioned in this issue, https://github.com/mongoid/mongoid/issues/3782.\r\n\r\nThis spec used to be fixed on https://github.com/mongoid/mongoid/pull/2664. However, it still got problem. Looking at the specs, `context.sort(number: 1, street: 1)` should sort by number first and only then by street. I just added a new address \"Kampuchea Krom\" to the test with a conflicting house number to verify the bug, and here is the result before this fix expects:\r\n\r\nStreet |Number\r\n------------ | -------------\r\nfriedel|1\r\nkampuchea-krom|5\r\npfluger|5\r\nlenau|5\r\nhobrecht|9\r\n\r\nThe expected result after the fix is then:\r\n\r\nStreet |Number\r\n------------ | -------------\r\nfriedel|1\r\nkampuchea-krom|5\r\nlenau|5\r\npfluger|5\r\nhobrecht|9"},"comment":{"url":"https://api.github.com/repos/mongoid/mongoid/issues/comments/73071068","html_url":"https://github.com/mongoid/mongoid/pull/3935#issuecomment-73071068","issue_url":"https://api.github.com/repos/mongoid/mongoid/issues/3935","id":73071068,"user":{"login":"arthurnn","id":833383,"avatar_url":"https://avatars.githubusercontent.com/u/833383?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurnn","html_url":"https://github.com/arthurnn","followers_url":"https://api.github.com/users/arthurnn/followers","following_url":"https://api.github.com/users/arthurnn/following{/other_user}","gists_url":"https://api.github.com/users/arthurnn/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurnn/subscriptions","organizations_url":"https://api.github.com/users/arthurnn/orgs","repos_url":"https://api.github.com/users/arthurnn/repos","events_url":"https://api.github.com/users/arthurnn/events{/privacy}","received_events_url":"https://api.github.com/users/arthurnn/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T16:00:59Z","updated_at":"2015-02-05T16:00:59Z","body":"Thanks for the fix!\r\nCan you add a changelog entry for it?"}}