Skip to content
Permalink
Browse files

⚠️ Using the last argument as keyword parameters is deprecated; maybe…

… ** should be added to the call

fixes #1010
  • Loading branch information
amatsuda committed Dec 27, 2019
1 parent a5bcbf8 commit 011d6ac3b866d5e1836c246f9a598c79d1213fe5
@@ -69,7 +69,7 @@ def prev_page_url(scope, options = {})
#
# It will return `nil` if there is no next page.
def next_page_path(scope, options = {})
Kaminari::Helpers::NextPage.new(self, options.reverse_merge(current_page: scope.current_page)).url if scope.next_page
Kaminari::Helpers::NextPage.new(self, **options.reverse_merge(current_page: scope.current_page)).url if scope.next_page
end
alias path_to_next_page next_page_path

@@ -83,7 +83,7 @@ def next_page_path(scope, options = {})
#
# It will return `nil` if there is no previous page.
def prev_page_path(scope, options = {})
Kaminari::Helpers::PrevPage.new(self, options.reverse_merge(current_page: scope.current_page)).url if scope.prev_page
Kaminari::Helpers::PrevPage.new(self, **options.reverse_merge(current_page: scope.current_page)).url if scope.prev_page
end
alias previous_page_path prev_page_path
alias path_to_previous_page prev_page_path
@@ -112,7 +112,7 @@ def paginate(scope, paginator_class: Kaminari::Helpers::Paginator, template: nil
options[:total_pages] ||= scope.total_pages
options.reverse_merge! current_page: scope.current_page, per_page: scope.limit_value, remote: false

paginator = paginator_class.new (template || self), options
paginator = paginator_class.new (template || self), **options
paginator.to_s
end

@@ -59,13 +59,13 @@ def relevant_pages(options)
private :relevant_pages

def page_tag(page)
@last = Page.new @template, @options.merge(page: page)
@last = Page.new @template, **@options.merge(page: page)
end

%w[first_page prev_page next_page last_page gap].each do |tag|
eval <<-DEF, nil, __FILE__, __LINE__ + 1
def #{tag}_tag
@last = #{tag.classify}.new @template, @options
@last = #{tag.classify}.new @template, **@options
end
DEF
end
@@ -35,7 +35,7 @@ def initialize(original_array = [], limit: nil, offset: nil, total_count: nil, p

# Used for page_entry_info
def entry_name(options = {})
I18n.t('helpers.page_entries_info.entry', options.reverse_merge(default: ENTRY.pluralize(options[:count])))
I18n.t('helpers.page_entries_info.entry', **options.reverse_merge(default: ENTRY.pluralize(options[:count])))
end

# items at the specified "page"

0 comments on commit 011d6ac

Please sign in to comment.
You can’t perform that action at this time.