From 9243193bc83ad495e63dc2ff3e69fd68c00423db Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Tue, 27 Feb 2024 15:36:45 -0800 Subject: [PATCH] Add support for `fits:alt-style-87305` item searches Easy peasy! --- app/models/item/search/query.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/models/item/search/query.rb b/app/models/item/search/query.rb index 342e04e2..cf3d4362 100644 --- a/app/models/item/search/query.rb +++ b/app/models/item/search/query.rb @@ -72,6 +72,16 @@ class Item Filter.not_fits_pet_type(pet_type, color_name:, species_name:) end + # Next, try the `fits:alt-style-87305` case. + match = value.match(/^alt-style-([0-9]+)$/) + if match.present? + alt_style_id, = match.captures + alt_style = load_alt_style_by_id(alt_style_id) + return is_positive ? + Filter.fits_alt_style(alt_style) : + Filter.not_fits_alt_style(alt_style) + end + # Next, try the `fits:nostalgic-faerie-draik` case. match = value.match(/^([^-]+)-([^-]+)-([^-]+)$/) if match.present?