diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index be691c85..1eee1de6 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -68,9 +68,8 @@ class ItemsController < ApplicationController @contributors_with_counts = @item.contributors_with_counts @supported_species_ids = @item.supported_species_ids - unless localized_fragment_exist?("items/show standard_species_images special_color=#{@item.special_color_id}") - @basic_colored_pet_types_by_species_id = PetType.special_color_or_basic(@item.special_color).includes_child_translations.group_by(&:species) - end + @basic_colored_pet_types_by_species_id = PetType.special_color_or_basic(@item.special_color). + includes_child_translations.group_by(&:species) @trading_closet_hangers_by_owned = { true => @item.closet_hangers.owned_trading.newest.includes(:user), diff --git a/app/models/pet_type_observer.rb b/app/models/pet_type_observer.rb deleted file mode 100644 index 2d5b4260..00000000 --- a/app/models/pet_type_observer.rb +++ /dev/null @@ -1,8 +0,0 @@ -class PetTypeObserver < ActiveRecord::Observer - include FragmentExpiration - - def after_create(pet_type) - images_key = "items/show standard_species_images special_color=#{pet_type.color_id}" - expire_fragment_in_all_locales(images_key) - end -end diff --git a/app/views/items/show.html.haml b/app/views/items/show.html.haml index f36d1ef0..923ca7e2 100644 --- a/app/views/items/show.html.haml +++ b/app/views/items/show.html.haml @@ -78,9 +78,7 @@ #item-preview %ul#item-preview-species{'data-supported-species-ids' => @supported_species_ids.join(',')} - -# TODO: filter by compatibility - - localized_cache "items/show standard_species_images special_color=#{@item.special_color_id}" do - = standard_species_images_for(@basic_colored_pet_types_by_species_id) + = standard_species_images_for(@basic_colored_pet_types_by_species_id) #item-preview-error #item-preview-swf= t '.preview.requirements_not_met' diff --git a/config/application.rb b/config/application.rb index 4007d276..6dfe87b1 100644 --- a/config/application.rb +++ b/config/application.rb @@ -14,7 +14,7 @@ module OpenneoImpressItems # Activate observers that should always be running config.active_record.observers = [:closet_hanger_observer, - :closet_list_observer, :pet_type_observer, :user_sweeper] + :closet_list_observer, :user_sweeper] # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.