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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user