1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-05 14:17:20 +00:00

Matche edit and mat show redirect properly

This commit is contained in:
2019-01-23 16:04:51 +00:00
parent 100317075b
commit 19f10ec80b
5 changed files with 8 additions and 16 deletions

View File

@@ -5,6 +5,7 @@ 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?
attr_accessor :redirect_path
def after_finished_actions
if self.finished == 1 && self.winner_id != nil