1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Run after match actions if score or win type change

This commit is contained in:
2020-01-03 13:15:05 -05:00
parent a709cb5c69
commit 981ba3d530

View File

@@ -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