1
0
Fork 0
forked from OpenNeo/impress

Fix PB item handling for Christmas Varwolf

It says "This item is part of a deluxe paint brush set.", with a period instead of exclamation mark.

There are also a couple cases where the paint brush item additionally has an "inspired by" credit after the first sentence. Rather than get picky about the pattern, we expand the `pb?` method to just check for the sentence as a substring, like the DB filter logic for `Item.is_pb` already does.
This commit is contained in:
Emi Matchu 2026-01-04 14:22:35 -08:00
parent 4e00f5d1af
commit a9c9f94dde

View file

@ -34,7 +34,7 @@ class Item < ApplicationRecord
attr_writer :current_body_id, :owned, :wanted
NCRarities = [0, 500]
PAINTBRUSH_SET_DESCRIPTION = 'This item is part of a deluxe paint brush set!'
PAINTBRUSH_SET_DESCRIPTION = 'This item is part of a deluxe paint brush set'
scope :newest, -> {
order(arel_table[:created_at].desc) if arel_table[:created_at]
@ -162,7 +162,7 @@ class Item < ApplicationRecord
end
def pb?
I18n.with_locale(:en) { self.description == PAINTBRUSH_SET_DESCRIPTION }
I18n.with_locale(:en) { self.description.include?(PAINTBRUSH_SET_DESCRIPTION) }
end
def np?