1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Refactored match winner and wrestlers matches and fixed slow tests.

This commit is contained in:
2025-04-25 15:59:35 -04:00
parent 3e4317dbc5
commit 1fcaec876f
20 changed files with 147 additions and 116 deletions

View File

@@ -54,11 +54,11 @@ class TournamentBackupService
end,
matches: @tournament.matches.sort_by(&:bout_number).map do |match|
match.attributes.merge(
w1_name: Wrestler.find_by(id: match.w1)&.name,
w2_name: Wrestler.find_by(id: match.w2)&.name,
winner_name: Wrestler.find_by(id: match.winner_id)&.name,
weight: Weight.find_by(id: match.weight_id)&.attributes,
mat: Mat.find_by(id: match.mat_id)&.attributes
w1_name: match.wrestler1&.name,
w2_name: match.wrestler2&.name,
winner_name: match.winner&.name,
weight: match.weight&.attributes,
mat: match.mat&.attributes
)
end
}