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

Fixed: query builder respects custom pagination params #267

Merged
merged 1 commit into from
Nov 22, 2017

Conversation

kdonovan
Copy link
Contributor

@kdonovan kdonovan commented Aug 7, 2017

Fixes an issue I was running into where the custom pagination params I set weren't being used when generating pagination queries.

@chingor13
Copy link
Collaborator

Can you make this test a separate one with a separate test resource? This changes the behavior of that one test and we lose it's original intent.

@kdonovan
Copy link
Contributor Author

Can do -- just added a new file for the param name test.

@chingor13 chingor13 merged commit 5b554b1 into JsonApiClient:master Nov 22, 2017
@ouranos
Copy link

ouranos commented Nov 27, 2017

@chingor13 @kdonovan this seems to introduce a regression as the default pagination params are now page and per_page as defined in JsonApiClient::Paginating::Paginator.
Before this change it was number and size.

Edit: to fix the issue I added this to an initializer:

JsonApiClient::Paginating::Paginator.page_param = 'number'
JsonApiClient::Paginating::Paginator.per_page_param = 'size'

@kdonovan
Copy link
Contributor Author

I feel like page/per_page is more in line with standard Rails defaults, but good catch -- that should have been documented better.

Thanks for providing the initializer fix for anyone bitten by that change!

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

Successfully merging this pull request may close these issues.

3 participants