WIP commit for speeding up item show pages
This commit is contained in:
parent
0cdbe99c88
commit
cc7ac363dd
3 changed files with 8 additions and 2 deletions
|
@ -27,6 +27,11 @@ module ItemsHelper
|
|||
end
|
||||
end
|
||||
|
||||
def standard_species_images_key_for(item)
|
||||
versions_count = 1 # TODO
|
||||
"foo" # TODO
|
||||
end
|
||||
|
||||
def standard_species_images_for(item)
|
||||
build_on_pet_types(item.supported_species, item.special_color) do |pet_type|
|
||||
image = pet_type_image(pet_type, :happy, :face)
|
||||
|
|
|
@ -192,8 +192,8 @@ class Item < ActiveRecord::Base
|
|||
|
||||
return Species.all if body_ids.include?(0)
|
||||
|
||||
pet_types = PetType.where(:body_id => body_ids).select([:species_id])
|
||||
species_ids = pet_types.map(&:species_id).uniq
|
||||
pet_types = PetType.where(:body_id => body_ids).select('DISTINCT species_id')
|
||||
species_ids = pet_types.map(&:species_id)
|
||||
|
||||
# If there are multiple known supported species, it probably supports them
|
||||
# all. (I've never heard of only a handful of species being supported :P)
|
||||
|
|
|
@ -79,6 +79,7 @@
|
|||
|
||||
#item-preview
|
||||
#item-preview-species
|
||||
-# localized_cache random_standard_species_images_key do
|
||||
= standard_species_images_for(@item)
|
||||
#item-preview-error
|
||||
#item-preview-swf= t '.preview.requirements_not_met'
|
||||
|
|
Loading…
Reference in a new issue