Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginator not respecting extra params #268

Open
ouranos opened this issue Aug 15, 2017 · 0 comments
Open

Paginator not respecting extra params #268

ouranos opened this issue Aug 15, 2017 · 0 comments

Comments

@ouranos
Copy link

ouranos commented Aug 15, 2017

I need to add a default params to one of my resources.

I found a way by using QueryBuilder#with_params:

class MyResource
  def self._new_scope
    query_builder.new(self).with_params(_foo: 'bar')
  end
end

The following works:

MyResource.all
MyResource.paginate(page: 2, per_page: 30).to_a

But when I do:

MyResource.paginate(page: 2, per_page: 30).pages.first
MyResource.all.pages.next

the extra params is not passed.

Am I doing it correctly? Or do I need to build a custom Requestor for this resource to add the params?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant