Skip to content

Commit

Permalink
Convert passed params to a Hash unless it is
Browse files Browse the repository at this point in the history
  • Loading branch information
5t111111 committed Aug 21, 2017
1 parent 686e27f commit 3465744
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kaminari-core/lib/kaminari/helpers/tags.rb
Expand Up @@ -24,7 +24,13 @@ def initialize(template, params: {}, param_name: nil, theme: nil, views_prefix:
@params = @params.to_unsafe_h if @params.respond_to?(:to_unsafe_h)
@params = @params.with_indifferent_access
@params.except!(*PARAM_KEY_BLACKLIST)
@params.reverse_merge! params
# params in Rails 5 may not be a Hash either,
# so it must be converted to a Hash to be merged into @params
unless params.empty?
params = params.to_unsafe_h if params.respond_to?(:to_unsafe_h)
params = params.with_indifferent_access
@params.merge! params
end
end

def to_s(locals = {}) #:nodoc:
Expand Down

0 comments on commit 3465744

Please sign in to comment.