Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
52ebfb77
Unverified
Commit
52ebfb77
authored
2 years ago
by
zunda
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Store integer settings as integer (#19478)
parent
1546538d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/form/admin_settings.rb
+8
-0
app/models/form/admin_settings.rb
with
8 additions
and
0 deletions
+8
-0
app/models/form/admin_settings.rb
+
8
-
0
View file @
52ebfb77
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets