Skip to content

Commit 980ce7c

Browse files
committed
Make definition of both Kaminari and WillPaginate warnings occur only if user hasn't explicitly set one of the paginators
1 parent 51a0b89 commit 980ce7c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/api-pagination/configuration.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ def configure(&block)
1313
def initialize
1414
@total_header = 'Total'
1515
@per_page_header = 'Per-Page'
16-
set_paginator
16+
end
17+
18+
def paginator
19+
@paginator || set_paginator
1720
end
1821

1922
def paginator=(paginator)
@@ -67,6 +70,8 @@ def set_paginator
6770
gem 'will_paginate'
6871
6972
WARNING
73+
74+
@paginator
7075
end
7176

7277
def use_kaminari

0 commit comments

Comments
 (0)