{"action":"opened","issue":{"url":"https://api.github.com/repos/mislav/will_paginate/issues/498","repository_url":"https://api.github.com/repos/mislav/will_paginate","labels_url":"https://api.github.com/repos/mislav/will_paginate/issues/498/labels{/name}","comments_url":"https://api.github.com/repos/mislav/will_paginate/issues/498/comments","events_url":"https://api.github.com/repos/mislav/will_paginate/issues/498/events","html_url":"https://github.com/mislav/will_paginate/issues/498","id":169366508,"number":498,"title":"ActiveRecord Relation size mismatch on last page when not loaded","user":{"login":"hallelujah","id":64276,"avatar_url":"https://avatars.githubusercontent.com/u/64276?v=3","gravatar_id":"","url":"https://api.github.com/users/hallelujah","html_url":"https://github.com/hallelujah","followers_url":"https://api.github.com/users/hallelujah/followers","following_url":"https://api.github.com/users/hallelujah/following{/other_user}","gists_url":"https://api.github.com/users/hallelujah/gists{/gist_id}","starred_url":"https://api.github.com/users/hallelujah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hallelujah/subscriptions","organizations_url":"https://api.github.com/users/hallelujah/orgs","repos_url":"https://api.github.com/users/hallelujah/repos","events_url":"https://api.github.com/users/hallelujah/events{/privacy}","received_events_url":"https://api.github.com/users/hallelujah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-04T12:50:37Z","updated_at":"2016-08-04T12:50:37Z","closed_at":null,"body":"This can be added to spec/finders/active_record_spec.rb\r\n\r\n```ruby\r\n  it 'returns correct `size` for last page' do\r\n    users = User.paginate(:page => 3, :per_page => 5)\r\n    users.total_entries.should == 13\r\n    users.total_pages.should == 3\r\n\r\n    users.size.should == 3\r\n  end\r\n```\r\n\r\nThe test is failing:\r\n\r\n```\r\nbundle exec rspec spec/finders/active_record_spec.rb:420                                                                                    [2.3]\r\nusing sqlite3 adapter\r\nRun filtered including {:line_number=>420}\r\nF\r\n\r\nFailures:\r\n\r\n  1) WillPaginate::ActiveRecord returns correct `size` for last page\r\n     Failure/Error: users.size.should == 3\r\n       expected: 3\r\n            got: 5 (using ==)\r\n     # ./spec/finders/active_record_spec.rb:425:in `block (2 levels) in <top (required)>'\r\n\r\nFinished in 0.00122 seconds\r\n1 example, 1 failure\r\n\r\nFailed examples:\r\n\r\nrspec ./spec/finders/active_record_spec.rb:420 # WillPaginate::ActiveRecord returns correct `size` for last page\r\n```"}}
{"actor":{"display_login":"hallelujah"}}