From 04af1ee31904e829a1c77c9bf38492e302570d00 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Tue, 20 Feb 2024 15:53:56 -0800 Subject: [PATCH] Migrate away from item translations in misc pages --- app/controllers/outfits_controller.rb | 4 ++-- app/controllers/pets_controller.rb | 5 +---- app/controllers/sitemap_controller.rb | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/controllers/outfits_controller.rb b/app/controllers/outfits_controller.rb index 372ede4f..1520017c 100644 --- a/app/controllers/outfits_controller.rb +++ b/app/controllers/outfits_controller.rb @@ -51,8 +51,8 @@ class OutfitsController < ApplicationController @species = Species.alphabetical newest_items = Item.newest. - select(:id, :name, :updated_at, :thumbnail_url, :rarity_index, :is_manually_nc). - includes(:translations).limit(18) + select(:id, :name, :updated_at, :thumbnail_url, :rarity_index, :is_manually_nc) + .limit(18) @newest_modeled_items, @newest_unmodeled_items = newest_items.partition(&:predicted_fully_modeled?) diff --git a/app/controllers/pets_controller.rb b/app/controllers/pets_controller.rb index 084cc91d..f4d8e19e 100644 --- a/app/controllers/pets_controller.rb +++ b/app/controllers/pets_controller.rb @@ -9,10 +9,7 @@ class PetsController < ApplicationController # return modeling_disabled unless user_signed_in? && current_user.admin? raise Pet::PetNotFound unless params[:name] - @pet = Pet.load( - params[:name], - :item_scope => Item.includes(:translations), - ) + @pet = Pet.load(params[:name]) points = contribute(current_user, @pet) respond_to do |format| diff --git a/app/controllers/sitemap_controller.rb b/app/controllers/sitemap_controller.rb index d65708a4..3b5c270c 100644 --- a/app/controllers/sitemap_controller.rb +++ b/app/controllers/sitemap_controller.rb @@ -3,7 +3,7 @@ class SitemapController < ApplicationController def index respond_to do |format| - format.xml { @items = Item.includes(:translations).sitemap } + format.xml { @items = Item.sitemap } end end end