{"action":"created","issue":{"url":"https://api.github.com/repos/amatsuda/kaminari/issues/572","labels_url":"https://api.github.com/repos/amatsuda/kaminari/issues/572/labels{/name}","comments_url":"https://api.github.com/repos/amatsuda/kaminari/issues/572/comments","events_url":"https://api.github.com/repos/amatsuda/kaminari/issues/572/events","html_url":"https://github.com/amatsuda/kaminari/issues/572","id":36380630,"number":572,"title":"Problematic AR count issue impacts Kaminari","user":{"login":"chemica","id":431545,"avatar_url":"https://avatars.githubusercontent.com/u/431545?v=3","gravatar_id":"","url":"https://api.github.com/users/chemica","html_url":"https://github.com/chemica","followers_url":"https://api.github.com/users/chemica/followers","following_url":"https://api.github.com/users/chemica/following{/other_user}","gists_url":"https://api.github.com/users/chemica/gists{/gist_id}","starred_url":"https://api.github.com/users/chemica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemica/subscriptions","organizations_url":"https://api.github.com/users/chemica/orgs","repos_url":"https://api.github.com/users/chemica/repos","events_url":"https://api.github.com/users/chemica/events{/privacy}","received_events_url":"https://api.github.com/users/chemica/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/amatsuda/kaminari/labels/ActiveRecord","name":"ActiveRecord","color":"d7e102"},{"url":"https://api.github.com/repos/amatsuda/kaminari/labels/Bug","name":"Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2014-06-24T12:54:06Z","updated_at":"2016-01-14T20:09:37Z","closed_at":null,"body":"If an ActiveRecord relation contains a select with aliases as well as a group_by clause that references them, count will fail. AR replaces the whole select clause, using fields from the group_by. As these fields are aliases defined in the original select, the count query fails.\r\n\r\nThis blows up when we attempt to display the pagination control.\r\n\r\nWe're using activerecord-3.2.15 and ruby-1.9.3-p547 currently.\r\n\r\nI've forked the repo to fix the issue in the AR relation methods code, and I'll update this ticket with any information I gain from running Travis tests against different ruby and AR versions."},"comment":{"url":"https://api.github.com/repos/amatsuda/kaminari/issues/comments/171765824","html_url":"https://github.com/amatsuda/kaminari/issues/572#issuecomment-171765824","issue_url":"https://api.github.com/repos/amatsuda/kaminari/issues/572","id":171765824,"user":{"login":"pokonski","id":135402,"avatar_url":"https://avatars.githubusercontent.com/u/135402?v=3","gravatar_id":"","url":"https://api.github.com/users/pokonski","html_url":"https://github.com/pokonski","followers_url":"https://api.github.com/users/pokonski/followers","following_url":"https://api.github.com/users/pokonski/following{/other_user}","gists_url":"https://api.github.com/users/pokonski/gists{/gist_id}","starred_url":"https://api.github.com/users/pokonski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pokonski/subscriptions","organizations_url":"https://api.github.com/users/pokonski/orgs","repos_url":"https://api.github.com/users/pokonski/repos","events_url":"https://api.github.com/users/pokonski/events{/privacy}","received_events_url":"https://api.github.com/users/pokonski/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T20:09:37Z","updated_at":"2016-01-14T20:09:37Z","body":"All these issues would be solved if we could just manually supply a count method in kaminari."}}