Skip to content

Commit 88a1210

Browse files
committed
Don't override the default per_page in Grape APIs
By leaving the default per_page setting in Grape APIs as nil, ApiPagination intercepts it later and uses the paginator's default per_page setting instead. Fixes #47. Signed-off-by: David Celis <[email protected]>
1 parent 28ec028 commit 88a1210

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/grape/pagination.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def paginate(collection)
3333

3434
base.class_eval do
3535
def self.paginate(options = {})
36-
route_setting :per_page, (options[:per_page] || 25)
36+
route_setting :per_page, options[:per_page]
3737
route_setting :max_per_page, options[:max_per_page]
3838
params do
3939
optional :page, :type => Integer, :default => 1,

0 commit comments

Comments
 (0)