Migrate away from item translations in misc pages

This commit is contained in:
Emi Matchu 2024-02-20 15:53:56 -08:00
parent b7bc0ecd70
commit 04af1ee319
3 changed files with 4 additions and 7 deletions

View file

@ -51,8 +51,8 @@ class OutfitsController < ApplicationController
@species = Species.alphabetical @species = Species.alphabetical
newest_items = Item.newest. newest_items = Item.newest.
select(:id, :name, :updated_at, :thumbnail_url, :rarity_index, :is_manually_nc). select(:id, :name, :updated_at, :thumbnail_url, :rarity_index, :is_manually_nc)
includes(:translations).limit(18) .limit(18)
@newest_modeled_items, @newest_unmodeled_items = @newest_modeled_items, @newest_unmodeled_items =
newest_items.partition(&:predicted_fully_modeled?) newest_items.partition(&:predicted_fully_modeled?)

View file

@ -9,10 +9,7 @@ class PetsController < ApplicationController
# return modeling_disabled unless user_signed_in? && current_user.admin? # return modeling_disabled unless user_signed_in? && current_user.admin?
raise Pet::PetNotFound unless params[:name] raise Pet::PetNotFound unless params[:name]
@pet = Pet.load( @pet = Pet.load(params[:name])
params[:name],
:item_scope => Item.includes(:translations),
)
points = contribute(current_user, @pet) points = contribute(current_user, @pet)
respond_to do |format| respond_to do |format|

View file

@ -3,7 +3,7 @@ class SitemapController < ApplicationController
def index def index
respond_to do |format| respond_to do |format|
format.xml { @items = Item.includes(:translations).sitemap } format.xml { @items = Item.sitemap }
end end
end end
end end