diff --git a/app/models/match.rb b/app/models/match.rb index 711c680..ac3bc7c 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -3,8 +3,8 @@ class Match < ActiveRecord::Base belongs_to :weight, touch: true belongs_to :mat, touch: true has_many :wrestlers, :through => :weight - after_update :after_finished_actions, :if => :finished_changed? - after_update :after_finished_actions, :if => :winner_id_changed? + after_update :after_finished_actions, :if => :saved_change_to_finished? + after_update :after_finished_actions, :if => :saved_change_to_winner_id? def after_finished_actions if self.finished == 1 && self.winner_id != nil