From ffb7d8be5bf955e76aa97a1bdc2acfd5001ab753 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Mon, 9 Jan 2023 19:15:51 -0500 Subject: [PATCH] Always clear the cache for wrestlers when the match changes --- app/models/match.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/match.rb b/app/models/match.rb index 4deeddf..802d2b3 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -8,13 +8,13 @@ class Match < ActiveRecord::Base after_update :after_finished_actions, :if => :saved_change_to_finished? or :saved_change_to_winner_id? or :saved_change_to_win_type? or :saved_change_to_score? def after_finished_actions + if self.w1 + wrestler1.touch + end + if self.w2 + wrestler2.touch + end if self.finished == 1 && self.winner_id != nil - if self.w1 - wrestler1.touch - end - if self.w2 - wrestler2.touch - end if self.mat self.mat.assign_next_match end