Skip to content

Commit

Permalink
Clone pagination data to avoid mutations.
Browse files Browse the repository at this point in the history
Closes stas#20
  • Loading branch information
stas committed Feb 8, 2020
1 parent 050ba76 commit 3d3c5c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jsonapi/pagination.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def jsonapi_pagination(resources)
*request.path_parameters.keys.map(&:to_s)
).to_unsafe_h.with_indifferent_access

original_params[:page] ||= {}
original_params[:page] = original_params[:page].dup || {}
original_url = request.base_url + request.path + '?'

pagination.each do |page_name, number|
Expand Down

0 comments on commit 3d3c5c0

Please sign in to comment.