lib/pragma/macro/pagination.rb in pragma-2.3.0 vs lib/pragma/macro/pagination.rb in pragma-2.4.0

- old
+ new

@@ -48,12 +48,10 @@ def normalize_params(options) # This is required because Rails treats all incoming parameters as strings, since it # can't distinguish. Maybe there's a better way to do it? options['params'].tap do |p| %w[pagination.page_param pagination.per_page_param].each do |key| - if p[options[key]] && p[options[key]].respond_to?(:to_i) - p[options[key]] = p[options[key]].to_i - end + p[options[key]] = p[options[key]].to_i if p[options[key]]&.respond_to?(:to_i) end end end def validate_params(options)