Skip to content

Conversation

@AMHOL
Copy link
Contributor

@AMHOL AMHOL commented Feb 17, 2017

Similar to #188 but maintains backwards compatibility as requested.

Param keys can be configured with:

JsonApiClient::Paginating::Paginator.configure do |config|
  config.page_param = "page[number]"
  config.per_page_param = "page[size]"
end

This PR adds a dependency on dry-configurable, I can remove this and implement it using plain old Ruby if desired.

Copy link
Collaborator

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'd rather not add an additional dependency for something that isn't that complex. There's already an established convention of using class_attribute for configuration.

The downside of the class_attribute config for the default paginator class is the case of 2 separate apis that have different pagination rules wouldn't both be able to use the same paginator class. In any case, I'm not sure that the dry-configurable gem would handle that scenario.

@AMHOL
Copy link
Contributor Author

AMHOL commented Feb 28, 2017

@chingor13 updated as requested

@chingor13 chingor13 merged commit c7b093c into JsonApiClient:master Mar 2, 2017
@chingor13
Copy link
Collaborator

Thanks!

@AMHOL AMHOL deleted the feature/confiurable-paginator branch March 2, 2017 09:05
@AMHOL
Copy link
Contributor Author

AMHOL commented Mar 2, 2017

Thanks for merging 😄

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.

2 participants