From 33e2a52f683697ca8489d856df90b39bfbbe7373 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 3 May 2016 11:29:45 -0300 Subject: use APP_CONFIG[config_file_paths] for provider.json This avoids overwriting the PROVIDER_JSON constant in the StaticConfigController and thus fixes test warnings. Also moved away from using instance variables in the ControllerExtension::JsonFile - instead querying the corresponding functions now - less sideeffects and easier stubbing. --- app/controllers/v1/configs_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'app/controllers/v1/configs_controller.rb') diff --git a/app/controllers/v1/configs_controller.rb b/app/controllers/v1/configs_controller.rb index 4a6f455..f0b284e 100644 --- a/app/controllers/v1/configs_controller.rb +++ b/app/controllers/v1/configs_controller.rb @@ -3,15 +3,13 @@ class V1::ConfigsController < ApiController before_filter :require_login, :unless => :anonymous_access_allowed? before_filter :sanitize_id, only: :show - before_filter :lookup_file, only: :show - before_filter :fetch_file, only: :show def index render json: {services: service_paths} end def show - send_file + send_file lookup_file end protected @@ -34,6 +32,6 @@ class V1::ConfigsController < ApiController def lookup_file path = APP_CONFIG[:config_file_paths][@id] not_found if path.blank? - @filename = Rails.root.join path + Rails.root.join path end end -- cgit v1.2.3