summaryrefslogtreecommitdiff
path: root/app/controllers/v1
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-05-03 11:29:45 -0300
committerAzul <azul@riseup.net>2016-05-03 11:49:24 -0300
commit33e2a52f683697ca8489d856df90b39bfbbe7373 (patch)
tree0cec8c6b9f3a20174089bb7633d7a075c53a5e90 /app/controllers/v1
parentfc066a42ec5a3271b0d476ff2c5ab771f1ab726d (diff)
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.
Diffstat (limited to 'app/controllers/v1')
-rw-r--r--app/controllers/v1/configs_controller.rb6
1 files changed, 2 insertions, 4 deletions
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