aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/public_body_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r--app/controllers/public_body_controller.rb4
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