diff options
author | Mark Longair <mhl@pobox.com> | 2013-08-15 12:28:48 +0100 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2013-08-20 12:11:45 +0100 |
commit | 5a33252694ceb86c2bb7a1b43e24c6b63425f7e1 (patch) | |
tree | 51c9026a8df40a6020c705c6e91185d69807413e /app/controllers/public_body_controller.rb | |
parent | 89e7318805b09cf32c4f919f2b09f522830fb9ec (diff) |
Make the minimum requests for statistics configurable
This adds the MINIMUM_REQUESTS_FOR_STATISTICS config option.
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r-- | app/controllers/public_body_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 2c8d83f6f..244fdfc92 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -152,7 +152,9 @@ class PublicBodyController < ApplicationController def statistics per_graph = 10 - minimum_requests = 1 + minimum_requests = AlaveteliConfiguration::minimum_requests_for_statistics + # Make sure minimum_requests is > 0 to avoid division-by-zero + minimum_requests = [minimum_requests, 1].max total_column = 'info_requests_count' graphs = [[total_column, |