1
0
Fork 0
forked from OpenNeo/impress

fix error loading lookups when given pet name has trailing spaces

This commit is contained in:
Emi Matchu 2012-06-05 13:28:59 -04:00
parent b25b6e55b3
commit 6cdf1567f8

View file

@ -71,7 +71,7 @@ class PetState < ActiveRecord::Base
# and its mood. # and its mood.
begin begin
user_pet = Neopets::User.new(username).pets. user_pet = Neopets::User.new(username).pets.
find { |user_pet| user_pet.name.downcase == pet.name.downcase } find { |user_pet| user_pet.name.downcase == pet.name.strip.downcase }
self.female = user_pet.female? self.female = user_pet.female?
self.mood_id = user_pet.mood.id self.mood_id = user_pet.mood.id
self.labeled = true self.labeled = true