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

Fixed depricated callback

This commit is contained in:
2018-05-03 12:55:23 +00:00
parent a8ee3ffa61
commit 37c106fb06

View File

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