Fix missing attribute error on homepage

Whoops, this has just always been wrong, right? I wonder what used to happen. Did it send extra queries???
This commit is contained in:
Emi Matchu 2023-08-02 16:24:27 -07:00
parent fc34208db9
commit 43835f5a25

View file

@ -55,11 +55,11 @@ class OutfitsController < ApplicationController
@newest_unmodeled_items_predicted_modeled_ratio = {} @newest_unmodeled_items_predicted_modeled_ratio = {}
@newest_unmodeled_items.each do |item| @newest_unmodeled_items.each do |item|
h = item.predicted_missing_nonstandard_body_ids_by_species_by_color( h = item.predicted_missing_nonstandard_body_ids_by_species_by_color(
Color.includes(:translations).select([:id]), Color.includes(:translations),
Species.includes(:translations).select([:id])) Species.includes(:translations))
standard_body_ids_by_species = item. standard_body_ids_by_species = item.
predicted_missing_standard_body_ids_by_species( predicted_missing_standard_body_ids_by_species(
Species.select([:id]).includes(:translations)) Species.includes(:translations))
if standard_body_ids_by_species.present? if standard_body_ids_by_species.present?
h[:standard] = standard_body_ids_by_species h[:standard] = standard_body_ids_by_species
end end