Allow to set the application timezone via secrets #5318
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References
This PR makes sense along with:
Objectives
If the installer PR#230 gets merged, installations can set the desired timezone from the installer.
This PR makes the application read the timezone from the application secrets. When the timezone is not defined in application secrets, the application uses Madrid as the default timezone.
This will allow Consul Democracy installations to change the application timezone via secrets without coding or deploying the application. Of course, after updating the secrets, the application must be restarted for the new timezone to take effect.
Release notes
Existing installations using a timezone other than Madrid can now add the
time_zone
entry to thesecrets.yml
file before deploying these changes so, if you have some custom code to set the application timezone, you can remove it and rely on the secrets configuration.You can search supported timezone names by running the following in the rails console:
ActiveSupport::TimeZone.all