1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-18 13:37:55 +00:00

Fixed n+1 error for matches page on tournament

This commit is contained in:
2021-11-08 22:42:55 +00:00
parent 7ee8abe81a
commit ad259f00b5
3 changed files with 4 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ class Match < ActiveRecord::Base
belongs_to :weight, touch: true
belongs_to :mat, touch: true
has_many :wrestlers, :through => :weight
has_many :schools, :through => :wrestlers
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