Skip to content

Commit 3c6a7cb

Browse files
committed
Merge pull request #36 from eidge/delay-warnings
Remove warnings if user has explicitly defined paginator
2 parents 51a0b89 + 9973bac commit 3c6a7cb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/api-pagination/configuration.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module ApiPagination
22
class Configuration
3-
attr_reader :paginator
4-
53
attr_accessor :total_header
64

75
attr_accessor :per_page_header
@@ -13,7 +11,10 @@ def configure(&block)
1311
def initialize
1412
@total_header = 'Total'
1513
@per_page_header = 'Per-Page'
16-
set_paginator
14+
end
15+
16+
def paginator
17+
@paginator || set_paginator
1718
end
1819

1920
def paginator=(paginator)
@@ -67,6 +68,8 @@ def set_paginator
6768
gem 'will_paginate'
6869
6970
WARNING
71+
72+
@paginator
7073
end
7174

7275
def use_kaminari

0 commit comments

Comments
 (0)