From 5c9abdeff1d0cf3e14d84c5ae298e6a5beccaf18 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 27 Sep 2022 03:08:19 +0200 Subject: Add retention policy for cached content and media (#19232) --- app/models/form/admin_settings.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models/form') diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index 97fabc6ac..3a7150916 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -32,6 +32,9 @@ class Form::AdminSettings show_domain_blocks_rationale noindex require_invite_text + media_cache_retention_period + content_cache_retention_period + backups_retention_period ).freeze BOOLEAN_KEYS = %i( @@ -64,6 +67,7 @@ class Form::AdminSettings validates :bootstrap_timeline_accounts, existing_username: { multiple: true } validates :show_domain_blocks, inclusion: { in: %w(disabled users all) } validates :show_domain_blocks_rationale, inclusion: { in: %w(disabled users all) } + validates :media_cache_retention_period, :content_cache_retention_period, :backups_retention_period, numericality: { only_integer: true } def initialize(_attributes = {}) super -- cgit From 1a5150e9c364635b989cd0983dac259f94dbbea9 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 29 Sep 2022 01:15:09 +0200 Subject: Fix content retention policy settings not accepting a blank value (#19248) --- app/models/form/admin_settings.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/form') diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index 3a7150916..1e6061277 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -67,7 +67,7 @@ class Form::AdminSettings validates :bootstrap_timeline_accounts, existing_username: { multiple: true } validates :show_domain_blocks, inclusion: { in: %w(disabled users all) } validates :show_domain_blocks_rationale, inclusion: { in: %w(disabled users all) } - validates :media_cache_retention_period, :content_cache_retention_period, :backups_retention_period, numericality: { only_integer: true } + validates :media_cache_retention_period, :content_cache_retention_period, :backups_retention_period, numericality: { only_integer: true }, allow_blank: true def initialize(_attributes = {}) super -- cgit