1
0
Fork 0
forked from OpenNeo/impress

Remove newest_items caching from items page

Yeah I'm very unconvinced of the merit of saving us one items/translations query lmao
This commit is contained in:
Matchu 2023-08-02 11:47:03 -07:00
parent 3ea22e6977
commit e9c16891c8
3 changed files with 4 additions and 8 deletions

View file

@ -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
}
format.js { render json: {error: '$q required'}}
end

View file

@ -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

View file

@ -28,7 +28,6 @@
%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