diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-12-23 17:59:39 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-04-27 16:54:19 +0100 |
commit | b849d9b7d0fd68d9bc72a4dd0725f2fbb2d6aa86 (patch) | |
tree | fafe9cd1b57a447d8bae69fc69cfdce4a54f594d /app/controllers/widgets_controller.rb | |
parent | 0a21b3aab637d2c00ba4d838797d5c5b819c32ba (diff) |
Allow widgets to be controlled with a feature flag.
Diffstat (limited to 'app/controllers/widgets_controller.rb')
-rw-r--r-- | app/controllers/widgets_controller.rb | 8 |
1 files changed, 7 insertions, 1 deletions
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 |