{"action":"closed","issue":{"url":"https://api.github.com/repos/amatsuda/kaminari/issues/807","repository_url":"https://api.github.com/repos/amatsuda/kaminari","labels_url":"https://api.github.com/repos/amatsuda/kaminari/issues/807/labels{/name}","comments_url":"https://api.github.com/repos/amatsuda/kaminari/issues/807/comments","events_url":"https://api.github.com/repos/amatsuda/kaminari/issues/807/events","html_url":"https://github.com/amatsuda/kaminari/issues/807","id":164901847,"number":807,"title":"nil can't be coerced into Fixnum","user":{"login":"mbajur","id":581569,"avatar_url":"https://avatars.githubusercontent.com/u/581569?v=3","gravatar_id":"","url":"https://api.github.com/users/mbajur","html_url":"https://github.com/mbajur","followers_url":"https://api.github.com/users/mbajur/followers","following_url":"https://api.github.com/users/mbajur/following{/other_user}","gists_url":"https://api.github.com/users/mbajur/gists{/gist_id}","starred_url":"https://api.github.com/users/mbajur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbajur/subscriptions","organizations_url":"https://api.github.com/users/mbajur/orgs","repos_url":"https://api.github.com/users/mbajur/repos","events_url":"https://api.github.com/users/mbajur/events{/privacy}","received_events_url":"https://api.github.com/users/mbajur/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-11T18:23:18Z","updated_at":"2016-07-11T18:40:02Z","closed_at":"2016-07-11T18:40:02Z","body":"Hello!\r\nI'm trying to use kaminari inside my service object (actually it's an operator from trailblazer). Here is a simplified version of my code:\r\n\r\n```\r\nclass MyService\r\n  def initialize\r\n    apply_pagination()\r\n  end\r\n  # ...\r\n\r\n  def model\r\n    Model.all\r\n  end\r\n\r\n  # ...\r\n\r\n  def apply_pagination\r\n    self.model = self.model.page(params[:page])\r\n  end\r\nend\r\n```\r\n\r\nFor some reason, when i'm trying to run any kaminari-related method on my results, kaminari throws `nil can't be coerced into Fixnum` at `lib/kaminari/models/page_scope_methods.rb:42`\r\n\r\nThat happens only when i'm trying to make it from inside my service/operation class. Running page() outside of it works just fine.\r\n\r\nThanks in advance for any clues!"}}
{"actor":{"display_login":"mbajur"}}