Skip to content
Snippets Groups Projects
Unverified Commit 52ebfb77 authored by zunda's avatar zunda Committed by GitHub
Browse files

Store integer settings as integer (#19478)

parent 1546538d
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,12 @@ class Form::AdminSettings
backups_retention_period
).freeze
INTEGER_KEYS = %i(
media_cache_retention_period
content_cache_retention_period
backups_retention_period
).freeze
BOOLEAN_KEYS = %i(
timeline_preview
activity_api_enabled
......@@ -104,6 +110,8 @@ class Form::AdminSettings
def typecast_value(key, value)
if BOOLEAN_KEYS.include?(key)
value == '1'
elsif INTEGER_KEYS.include?(key)
value.blank? ? value : Integer(value)
else
value
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment