Skip to content

Commit

Permalink
Don't pass anything but page/per_page/total_entries
Browse files Browse the repository at this point in the history
Signed-off-by: David Celis <me@davidcel.is>
  • Loading branch information
davidcelis committed May 22, 2017
1 parent 08de2b3 commit 2c69c7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/api-pagination.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def paginate_with_will_paginate(collection, options)
if defined?(Sequel::Dataset) && collection.kind_of?(Sequel::Dataset)
collection.paginate(options[:page], options[:per_page])
else
supported_options = [:page, :per_page, :total_entries]
options = options.dup.keep_if { |k,v| supported_options.include?(k.to_sym) }
collection.paginate(options)
end
end
Expand Down

0 comments on commit 2c69c7a

Please sign in to comment.