From b849d9b7d0fd68d9bc72a4dd0725f2fbb2d6aa86 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 23 Dec 2014 17:59:39 +0000 Subject: Allow widgets to be controlled with a feature flag. --- app/controllers/widgets_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/controllers/widgets_controller.rb') diff --git a/app/controllers/widgets_controller.rb b/app/controllers/widgets_controller.rb index bdbabeac4..017d3a77f 100644 --- a/app/controllers/widgets_controller.rb +++ b/app/controllers/widgets_controller.rb @@ -8,7 +8,7 @@ require 'securerandom' class WidgetsController < ApplicationController - before_filter :find_info_request + before_filter :check_widget_config, :find_info_request def show medium_cache @@ -40,4 +40,10 @@ class WidgetsController < ApplicationController @info_request = InfoRequest.find(params[:request_id]) end + def check_widget_config + unless AlaveteliConfiguration::enable_widgets + raise ActiveRecord::RecordNotFound.new("Page not enabled") + end + end + end -- cgit v1.2.3