diff options
author | Mark Longair <mhl@pobox.com> | 2013-08-20 10:04:54 +0100 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2013-08-20 12:11:45 +0100 |
commit | b75d79b08227192b75e4f3b24ce4e762f4286ef9 (patch) | |
tree | 6a9645f51e17da0048f92b9eb54f8465cd498a13 /app/controllers/public_body_controller.rb | |
parent | 493c1a270b02bf1cd6030e56babefcca89a81595 (diff) |
Add a config option to enable the public body statistics page
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r-- | app/controllers/public_body_controller.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index b5d4ede90..ebf159d79 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -151,6 +151,10 @@ class PublicBodyController < ApplicationController end def statistics + unless AlaveteliConfiguration::public_body_statistics_page + raise ActiveRecord::RecordNotFound.new("Page not enabled") + end + per_graph = 10 minimum_requests = AlaveteliConfiguration::minimum_requests_for_statistics # Make sure minimum_requests is > 0 to avoid division-by-zero |