From 981ba3d530ea2e6a97b88b1b31dbbf22cc0e4036 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Fri, 3 Jan 2020 13:15:05 -0500 Subject: [PATCH] Run after match actions if score or win type change --- app/models/match.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/match.rb b/app/models/match.rb index cdf6787..548a7f8 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -5,6 +5,8 @@ class Match < ActiveRecord::Base has_many :wrestlers, :through => :weight after_update :after_finished_actions, :if => :saved_change_to_finished? after_update :after_finished_actions, :if => :saved_change_to_winner_id? + after_update :after_finished_actions, :if => :saved_change_to_win_type? + after_update :after_finished_actions, :if => :saved_change_to_score? def after_finished_actions if self.finished == 1 && self.winner_id != nil