Do not pass application_setting to ApplicationSettings::UpdateService
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Move the logic of which ApplicationSetting to update into the ApplicationSettings::UpdateService instead of having each caller pass this as a parameter.
Improvements
This will ensure that the logic is in a single place instead of everywhere that the service is called.
Which ApplicationSetting to update is not straightforward since it is cached and might also not exist in certain situations like when setting up the database for the first time.
Risks
Involved components
The ApplicationSettings::UpdateService and its spec:
- app/services/application_settings/update_service.rb
- spec/services/application_settings/update_service_spec.rb
And the locations where ApplicationSettings::UpdateService is called
- app/controllers/admin/application_settings_controller.rb
- app/controllers/application_controller.rb
- app/services/self_monitoring/project/create_service.rb
- lib/api/settings.rb
- spec/support/helpers/terms_helper.rb
Optional: Intended side effects
Optional: Missing test coverage
Edited by 🤖 GitLab Bot 🤖