fix bug in determining special color
Specifically, the Tyrannian Meerca Spear is a pb item that contains "pea", so its item page is only willing to show a Pea Chia. Now, a color must be a whole word in the item name for special color determination to work.
This commit is contained in:
parent
7f2ce2839b
commit
5d618237a9
1 changed files with 2 additions and 2 deletions
|
@ -160,9 +160,9 @@ class Item < ActiveRecord::Base
|
||||||
# Rather than go find the special description in all locales, let's just
|
# Rather than go find the special description in all locales, let's just
|
||||||
# run this logic in English.
|
# run this logic in English.
|
||||||
if description.include?(PAINTBRUSH_SET_DESCRIPTION)
|
if description.include?(PAINTBRUSH_SET_DESCRIPTION)
|
||||||
downcased_name = name.downcase
|
name_words = name.downcase.split
|
||||||
Color.nonstandard.each do |color|
|
Color.nonstandard.each do |color|
|
||||||
return color if downcased_name.include?(color.name)
|
return color if name_words.include?(color.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue