From c3480909a2f864cd900974b34d2ac972300967e5 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Thu, 19 Jan 2023 01:47:32 +0000 Subject: [PATCH] Fixed school show caching --- app/models/mat.rb | 2 ++ app/views/schools/show.html.erb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/mat.rb b/app/models/mat.rb index c6f139f..4404641 100644 --- a/app/models/mat.rb +++ b/app/models/mat.rb @@ -28,9 +28,11 @@ class Mat < ActiveRecord::Base if match.save if match.w1 match.wrestler1.touch + match.wrestler1.school.touch end if match.w2 match.wrestler2.touch + match.wrestler2.school.touch end return true else diff --git a/app/views/schools/show.html.erb b/app/views/schools/show.html.erb index fb8e682..a4362f2 100644 --- a/app/views/schools/show.html.erb +++ b/app/views/schools/show.html.erb @@ -1,4 +1,3 @@ -<% cache ["#{@school.id}_school_show", @school] do %>

Name: <%= @school.name %> @@ -38,6 +37,7 @@ +<% cache ["#{@school.id}_school_show", @school] do %> <% @wrestlers.sort_by{|w| w.weight.max}.each do |wrestler| %> <%= link_to "#{wrestler.name}", wrestler %>