diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index cb37a522174d43..4069b64790e97e 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -91,7 +91,9 @@ class Form::AdminSettings elsif OVERRIDEN_SETTINGS.include?(key) public_send(OVERRIDEN_SETTINGS[key]) else - Setting.public_send(key) + # Avoid any of the emergency overrides by not doing + # Setting.public_send(key) + Setting[key.to_s] end instance_variable_set(:"@#{key}", stored_value) diff --git a/app/models/setting.rb b/app/models/setting.rb index 3bdc6ffb40cca3..b4f8a42e37ba0e 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -57,5 +57,11 @@ def default_settings RailsSettings::Default.instance end + + Emergency::SettingOverrideAction::ALLOWED_SETTINGS.each_key do |key| + define_method(key) do + Emergency::SettingOverrideAction.overridden_setting(key) || self[key] + end + end end end