mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-06 22:44:14 +00:00
Always clear the cache for wrestlers when the match changes
This commit is contained in:
@@ -8,13 +8,13 @@ class Match < ActiveRecord::Base
|
|||||||
after_update :after_finished_actions, :if => :saved_change_to_finished? or :saved_change_to_winner_id? or :saved_change_to_win_type? or :saved_change_to_score?
|
after_update :after_finished_actions, :if => :saved_change_to_finished? or :saved_change_to_winner_id? or :saved_change_to_win_type? or :saved_change_to_score?
|
||||||
|
|
||||||
def after_finished_actions
|
def after_finished_actions
|
||||||
|
if self.w1
|
||||||
|
wrestler1.touch
|
||||||
|
end
|
||||||
|
if self.w2
|
||||||
|
wrestler2.touch
|
||||||
|
end
|
||||||
if self.finished == 1 && self.winner_id != nil
|
if self.finished == 1 && self.winner_id != nil
|
||||||
if self.w1
|
|
||||||
wrestler1.touch
|
|
||||||
end
|
|
||||||
if self.w2
|
|
||||||
wrestler2.touch
|
|
||||||
end
|
|
||||||
if self.mat
|
if self.mat
|
||||||
self.mat.assign_next_match
|
self.mat.assign_next_match
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user