diff options
author | Azul <azul@riseup.net> | 2016-05-03 11:29:45 -0300 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-05-03 11:49:24 -0300 |
commit | 33e2a52f683697ca8489d856df90b39bfbbe7373 (patch) | |
tree | 0cec8c6b9f3a20174089bb7633d7a075c53a5e90 /app/controllers/static_config_controller.rb | |
parent | fc066a42ec5a3271b0d476ff2c5ab771f1ab726d (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/static_config_controller.rb')
-rw-r--r-- | app/controllers/static_config_controller.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/app/controllers/static_config_controller.rb b/app/controllers/static_config_controller.rb index c78e006..46e7cd2 100644 --- a/app/controllers/static_config_controller.rb +++ b/app/controllers/static_config_controller.rb @@ -5,13 +5,9 @@ class StaticConfigController < ActionController::Base include ControllerExtension::JsonFile before_filter :set_minimum_client_version - before_filter :set_filename - before_filter :fetch_file - - PROVIDER_JSON = Rails.root.join('config', 'provider', 'provider.json') def provider - send_file + send_file provider_json end protected @@ -23,7 +19,8 @@ class StaticConfigController < ActionController::Base APP_CONFIG[:minimum_client_version].to_s end - def set_filename - @filename = PROVIDER_JSON + def provider_json + Rails.root.join APP_CONFIG[:config_file_paths]['provider'] end + end |