Stop inferring AltStyle series name, now that it's getting more varied

They're not all Nostalgic anymore! Oh, how the times have changed!

This way, new ones will appear as "<New?>", until support staff come in
and label them (with our cool new tools!)
This commit is contained in:
Emi Matchu 2024-10-18 17:07:38 -07:00
parent e7a0ff1234
commit 6b7c73870a

View file

@ -12,7 +12,6 @@ class AltStyle < ApplicationRecord
validates :series_name, presence: true, allow_nil: true
validates :thumbnail_url, presence: true
before_validation :infer_series_name, unless: :has_real_series_name?
before_validation :infer_thumbnail_url, unless: :thumbnail_url?
scope :matching_name, ->(series_name, color_name, species_name) {
@ -74,19 +73,6 @@ class AltStyle < ApplicationRecord
end
end
# Until the end of 2024, assume new alt styles are from the "Nostalgic"
# series. That way, we can stop having to manually label them all as they
# come out and get modeled (TNT is prolific rn!), but we aren't gonna get too
# greedy and forget about this and use Nostalgic for some far-future thing,
# in ways that will certainly be fixable but would also be confusing and
# embarrassing.
NOSTALGIC_FINAL_DAY = Date.new(2024, 12, 31)
def infer_series_name
if Date.today <= NOSTALGIC_FINAL_DAY
self.series_name = "Nostalgic"
end
end
# At time of writing, most batches of Alt Styles thumbnails used a simple
# pattern for the item thumbnail URL, but that's not always the case anymore.
# For now, let's keep using this format as the default value when creating a