From e9c16891c89f875e4b13071c71812a16eee0cd32 Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 2 Aug 2023 11:47:03 -0700 Subject: [PATCH] Remove newest_items caching from items page Yeah I'm very unconvinced of the merit of saving us one items/translations query lmao --- app/controllers/items_controller.rb | 4 +--- app/models/item/create_task.rb | 1 - app/views/items/index.html.haml | 7 +++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index 2c49569d..b2d12974 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -46,9 +46,7 @@ class ItemsController < ApplicationController respond_to do |format| format.html { @campaign = Campaign.current rescue nil - unless localized_fragment_exist?('items#index newest_items') - @newest_items = Item.newest.includes(:translations).limit(18) - end + @newest_items = Item.newest.includes(:translations).limit(18) } format.js { render json: {error: '$q required'}} end diff --git a/app/models/item/create_task.rb b/app/models/item/create_task.rb index 8e20d3dc..fce4ee49 100644 --- a/app/models/item/create_task.rb +++ b/app/models/item/create_task.rb @@ -14,7 +14,6 @@ class Item def self.expire_newest_items expire_fragment_in_all_locales('outfits#new newest_items') - expire_fragment_in_all_locales('items#index newest_items') end end end \ No newline at end of file diff --git a/app/views/items/index.html.haml b/app/views/items/index.html.haml index f562965f..818c4f66 100644 --- a/app/views/items/index.html.haml +++ b/app/views/items/index.html.haml @@ -28,10 +28,9 @@ %dt= t '.examples.type.query' %dd= t '.examples.type.description' - - localized_cache 'items#index newest_items' do - #search-new-items - %h2= t '.newest_items.header' - = render @newest_items + #search-new-items + %h2= t '.newest_items.header' + = render @newest_items - localized_cache :action_suffix => 'species_search_links' do #species-search-links