1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

Don't have to carry paginator_class option over the paginator instance

This commit is contained in:
Akira Matsuda 2016-11-19 16:33:45 +09:00
parent 6080b7a32c
commit 23d0bf2d86

View file

@ -22,9 +22,9 @@ module Kaminari
# * <tt>:ANY_OTHER_VALUES</tt> - Any other hash key & values would be directly passed into each tag as :locals value.
def paginate(scope, options = {})
options[:total_pages] ||= scope.total_pages
options[:paginator_class] ||= Kaminari::Helpers::Paginator
paginator = options[:paginator_class].new(self, options.reverse_merge(:current_page => scope.current_page, :per_page => scope.limit_value, :remote => false))
paginator_class = options[:paginator_class] || Kaminari::Helpers::Paginator
paginator = paginator_class.new(self, options.reverse_merge(:current_page => scope.current_page, :per_page => scope.limit_value, :remote => false))
paginator.to_s
end