From 5f9a1aaec3fe6d795ca000aadf7c8813f4b062e4 Mon Sep 17 00:00:00 2001 From: Makyen Date: Mon, 11 Nov 2024 10:53:41 -0800 Subject: [PATCH] Spam wave expiration validation to <= 368.day.from_now The way we've been using spam waves has changed over the years. While the default creation length remains 1 day and "renew" remains 2 days, there are multiple spam waves which we are keeping active continuously, and have done so for years. I'm quite tired of having the daily task of renewing them, as I've been doing nearly every day for a couple/few years now. This change will allow manually editing the expiration time to 1 year in the future from any automated (i.e., 1 or 2 day) date. --- app/models/spam_wave.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/spam_wave.rb b/app/models/spam_wave.rb index b5729f7e..6b4134b1 100644 --- a/app/models/spam_wave.rb +++ b/app/models/spam_wave.rb @@ -124,7 +124,7 @@ def check_min_accuracy end def max_expiry - return if expiry <= 2.day.from_now + return if expiry <= 368.day.from_now errors.add(:expiry, 'must be no more than 48 hours from now') end end