From 5d618237a992d681a6fcf81e9298a9e1b7593cd7 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 3 Feb 2013 13:31:22 -0600 Subject: [PATCH] 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. --- app/models/item.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/item.rb b/app/models/item.rb index e5e8bcee..185131c4 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -160,9 +160,9 @@ class Item < ActiveRecord::Base # Rather than go find the special description in all locales, let's just # run this logic in English. if description.include?(PAINTBRUSH_SET_DESCRIPTION) - downcased_name = name.downcase + name_words = name.downcase.split Color.nonstandard.each do |color| - return color if downcased_name.include?(color.name) + return color if name_words.include?(color.name) end end