Add page_access_method and per_page_access_method#28
Open
edugonch wants to merge 1 commit intoIcaliaLabs:masterfrom
Open
Add page_access_method and per_page_access_method#28edugonch wants to merge 1 commit intoIcaliaLabs:masterfrom
edugonch wants to merge 1 commit intoIcaliaLabs:masterfrom
Conversation
Member
|
This seems practical! Let me review it and come back to you! |
kurenn
requested changes
Apr 30, 2019
|
|
||
| # per page access method | ||
| mattr_accessor :per_page_access_method | ||
| @@per_page_access_method = :per |
Member
There was a problem hiding this comment.
Maybe we can rename this to per_page to match a default value for Kaminari and WillPaginate, how does that sound?
| options[:per_page] = options.delete(:per_page) || params[:per_page] || ::Kaminari.config.default_per_page | ||
|
|
||
| collection.page(options[:page]).per(options[:per_page]) | ||
| collection.send(PagerApi.page_access_method, options[:page]).send(PagerApi.per_page_access_method, options[:per_page]) |
Member
There was a problem hiding this comment.
There is a meta which I think you can update to meet this two accessors, what do you think?
Also there can you provide the update for the will_paginate driver module to meet this as well?
Thanks for the collaboration!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Example
/config/initializers/kaminari_config.rb
/config/initializers/pager_api.rb