1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +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

@@ -134,7 +134,7 @@ class TournamentsController < ApplicationController
end
def matches
@matches = @tournament.matches.sort_by{|m| m.bout_number}
@matches = @tournament.matches.includes(:wrestlers,:schools).sort_by{|m| m.bout_number}
if @match
@w1 = @match.wrestler1
@w2 = @match.wrestler2