File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class Configuration
2525 attr_accessor :beta_probability_simulations
2626 attr_accessor :winning_alternative_recalculation_interval
2727 attr_accessor :redis
28+ attr_accessor :dashboard_pagination_default_per_page
2829
2930 attr_reader :experiments
3031
@@ -226,6 +227,7 @@ def initialize
226227 @beta_probability_simulations = 10000
227228 @winning_alternative_recalculation_interval = 60 * 60 * 24 # 1 day
228229 @redis = ENV . fetch ( ENV . fetch ( 'REDIS_PROVIDER' , 'REDIS_URL' ) , 'redis://localhost:6379' )
230+ @dashboard_pagination_default_per_page = 10
229231 end
230232
231233 def redis_url = ( value )
Original file line number Diff line number Diff line change 33
44module Split
55 module DashboardPaginationHelpers
6- DEFAULT_PER = 10
7-
86 def pagination_per
9- @pagination_per ||= ( params [ :per ] || DEFAULT_PER ) . to_i
7+ default_per_page = Split . configuration . dashboard_pagination_default_per_page
8+ @pagination_per ||= ( params [ :per ] || default_per_page ) . to_i
109 end
1110
1211 def page_number
Original file line number Diff line number Diff line change 1010 context 'when params empty' do
1111 let ( :params ) { Hash [ ] }
1212
13- it 'returns 10' do
13+ it 'returns the default (10)' do
14+ default_per_page = Split . configuration . dashboard_pagination_default_per_page
15+ expect ( pagination_per ) . to eql default_per_page
1416 expect ( pagination_per ) . to eql 10
1517 end
1618 end
You can’t perform that action at this time.
0 commit comments