From 2501e6e21fcb5be043284042c12ea8ddb948dbb0 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 14 Nov 2010 23:14:04 -0500 Subject: [PATCH] use basic image hash on items stuff --- app/helpers/items_helper.rb | 2 +- app/models/pet_type.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/helpers/items_helper.rb b/app/helpers/items_helper.rb index a14a59bf..73d45455 100644 --- a/app/helpers/items_helper.rb +++ b/app/helpers/items_helper.rb @@ -69,7 +69,7 @@ module ItemsHelper def pet_type_image(pet_type, emotion, size) emotion_id = PetTypeImage::Emotions[emotion] size_id = PetTypeImage::Sizes[size] - src = sprintf(PetTypeImage::Format, pet_type.image_hash, emotion_id, size_id) + src = sprintf(PetTypeImage::Format, pet_type.basic_image_hash, emotion_id, size_id) human_name = pet_type.species.name.humanize image_tag(src, :alt => human_name, :title => human_name) end diff --git a/app/models/pet_type.rb b/app/models/pet_type.rb index 6456405c..ee5c30c4 100644 --- a/app/models/pet_type.rb +++ b/app/models/pet_type.rb @@ -62,7 +62,11 @@ class PetType < ActiveRecord::Base end def image_hash - self['image_hash'] || BasicHashes[species.name][color.name] + self['image_hash'] || basic_image_hash + end + + def basic_image_hash + BasicHashes[species.name][color.name] end def human_name