From 98ecbf029da3537aa73e8bb653586f0d8dccb54d Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 18 Jun 2024 15:20:27 -0700 Subject: [PATCH] Be case-insensitive when checking Owls values for Dyeworks status Just to be a bit more resilient! I'm not aware of any issues rn but this seems wise! --- app/models/item/dyeworks.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/item/dyeworks.rb b/app/models/item/dyeworks.rb index e873275e..fe971234 100644 --- a/app/models/item/dyeworks.rb +++ b/app/models/item/dyeworks.rb @@ -14,16 +14,18 @@ class Item # Whether this is one of the few Dyeworks items that can be dyed in the NC # Mall at any time, rather than as part of a limited-time event. (Owls tracks # this, not us!) + DYEWORKS_PERMANENT_PATTERN = /Permanent Dyeworks/i def dyeworks_permanent? return false if nc_trade_value.nil? - nc_trade_value.value_text.include?("Permanent Dyeworks") + nc_trade_value.value_text.match?(DYEWORKS_PERMANENT_PATTERN) end # Whether this is a Dyeworks item that can be dyed in the NC Mall ~right now, # but only as part of a limited-time event. (Owls tracks this, not us!) + DYEWORKS_LIMITED_PATTERN = /Limited Dyeworks/i def dyeworks_limited? return false if nc_trade_value.nil? - nc_trade_value.value_text.include?("Limited Dyeworks") + nc_trade_value.value_text.match?(DYEWORKS_LIMITED_PATTERN) end # Whether this is a Dyeworks item that can be dyed in the NC Mall ~right now,