Skip to content

Commit

Permalink
⚠️ Using the last argument as keyword parameters is deprecated; maybe…
Browse files Browse the repository at this point in the history
… ** should be added to the call

fixes #1010
  • Loading branch information
amatsuda committed Dec 27, 2019
1 parent a5bcbf8 commit 011d6ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions kaminari-core/lib/kaminari/helpers/helper_methods.rb
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions kaminari-core/lib/kaminari/helpers/paginator.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kaminari-core/lib/kaminari/models/array_extension.rb
Expand Up @@ -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"
Expand Down

0 comments on commit 011d6ac

Please sign in to comment.