From 860b8eef720dfaecc08d995611da811d19eaa6a0 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Wed, 2 Oct 2024 18:26:49 -0700 Subject: [PATCH] Remove not-very-useful caching for homepage modeling Huh, I hadn't realized that like, we'd already set up the controller to always *run* basically all of the modeling logic, and the caching in the view layer wasn't saving us any queries anymore. Kinda silly! Remove the caching call, just to simplify the codebase (I like to avoid caching things that don't specifically need it!). And hey, love that the modeling code in the controller is now *way* faster to run! You love to see it! --- app/views/outfits/new.html.haml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/views/outfits/new.html.haml b/app/views/outfits/new.html.haml index 3aca7cd4..2f8ca0e6 100644 --- a/app/views/outfits/new.html.haml +++ b/app/views/outfits/new.html.haml @@ -90,15 +90,14 @@ %h3= t '.newest_items.unmodeled.header' %ul#newest-unmodeled-items - @newest_unmodeled_items.each do |item| - - cache "items/#{item.id} modeling_progress locale=#{I18n.locale} updated_at=#{item.updated_at.to_i}" do - %li{'data-item-id' => item.id} - = link_to image_tag(item.thumbnail_url), item, :class => 'image-link' - = link_to item, :class => 'header' do - %h2= item.name - %span.meter{style: "width: #{@newest_unmodeled_items_predicted_modeled_ratio[item]*100}%"} - .missing-bodies - = render_predicted_missing_species_by_color(@newest_unmodeled_items_predicted_missing_species_by_color[item]) - .models + %li{'data-item-id' => item.id} + = link_to image_tag(item.thumbnail_url), item, :class => 'image-link' + = link_to item, :class => 'header' do + %h2= item.name + %span.meter{style: "width: #{@newest_unmodeled_items_predicted_modeled_ratio[item]*100}%"} + .missing-bodies + = render_predicted_missing_species_by_color(@newest_unmodeled_items_predicted_missing_species_by_color[item]) + .models - if @newest_modeled_items.present? %h3= t '.newest_items.modeled.header' %ul#newest-modeled-items