Unverified Commit 52ebfb77 authored by zunda's avatar zunda Committed by GitHub
Browse files

Store integer settings as integer (#19478)

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