diff --git a/app/helpers/items_helper.rb b/app/helpers/items_helper.rb index d160a785..e27c49f1 100644 --- a/app/helpers/items_helper.rb +++ b/app/helpers/items_helper.rb @@ -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) diff --git a/app/models/item.rb b/app/models/item.rb index b1d66847..69b5f860 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -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) diff --git a/app/views/items/show.html.haml b/app/views/items/show.html.haml index 8ba6f8a4..da40a2f2 100644 --- a/app/views/items/show.html.haml +++ b/app/views/items/show.html.haml @@ -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'