From e458cbcf4034278d194af184e811c45627f2fef2 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Fri, 19 Apr 2019 22:46:47 -0400 Subject: [PATCH] Add pool_placement and pool_placement_tiebreaker to importer and exporter --- app/services/tournament_services/wrestlingdev_importer.rb | 2 ++ app/views/tournaments/export.html.erb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/services/tournament_services/wrestlingdev_importer.rb b/app/services/tournament_services/wrestlingdev_importer.rb index 83c9d36..cd08567 100644 --- a/app/services/tournament_services/wrestlingdev_importer.rb +++ b/app/services/tournament_services/wrestlingdev_importer.rb @@ -94,6 +94,8 @@ class WrestlingdevImporter new_wrestler.extra = wrestler_array[8] new_wrestler.offical_weight = wrestler_array[9] new_wrestler.pool = wrestler_array[10] + new_wrestler.pool_placement = wrestler_array[11] + new_wrestler.pool_placement_tiebreaker = wrestler_array[12] new_wrestler.save end end diff --git a/app/views/tournaments/export.html.erb b/app/views/tournaments/export.html.erb index f89d137..f07c617 100644 --- a/app/views/tournaments/export.html.erb +++ b/app/views/tournaments/export.html.erb @@ -17,6 +17,6 @@
--Mats--<% @tournament.mats.each do |mat| %><%= model_separator %><%= mat.name %><% end %>
---Wrestlers--<% @tournament.wrestlers.each do |wrestler| %><%= model_separator %><%= wrestler.name %><%= attribute_separator %><%= wrestler.school.name %><%= attribute_separator %><%= wrestler.weight.max %><%= attribute_separator %><%= wrestler.bracket_line %><%= attribute_separator %><%= wrestler.original_seed %><%= attribute_separator %><%= wrestler.season_win %><%= attribute_separator %><%= wrestler.season_loss %><%= attribute_separator %><%= wrestler.criteria %><%= attribute_separator %><%= wrestler.extra %><%= attribute_separator %><%= wrestler.offical_weight %><%= attribute_separator %><%= wrestler.pool %><% end %> +--Wrestlers--<% @tournament.wrestlers.each do |wrestler| %><%= model_separator %><%= wrestler.name %><%= attribute_separator %><%= wrestler.school.name %><%= attribute_separator %><%= wrestler.weight.max %><%= attribute_separator %><%= wrestler.bracket_line %><%= attribute_separator %><%= wrestler.original_seed %><%= attribute_separator %><%= wrestler.season_win %><%= attribute_separator %><%= wrestler.season_loss %><%= attribute_separator %><%= wrestler.criteria %><%= attribute_separator %><%= wrestler.extra %><%= attribute_separator %><%= wrestler.offical_weight %><%= attribute_separator %><%= wrestler.pool %><%= attribute_separator %><%= wrestler.pool_placement %><%= attribute_separator %><%= wrestler.pool_placement_tiebreaker %><% end %>
--Matches--<% @tournament.matches.sort_by{|match| match.bout_number}.each do |match| %><%= model_separator %><%= Wrestler.where("id = ?",match.w1).first.name if match.w1 %><%= attribute_separator %><%= Wrestler.where("id = ?",match.w2).first.name if match.w2 %><%= attribute_separator %><%= match.w1_stat %><%= attribute_separator %><%= match.w2_stat %><%= attribute_separator %><%= Wrestler.where("id = ?",match.winner_id).first.name if match.winner_id %><%= attribute_separator %><%= match.win_type %><%= attribute_separator %><%= match.score %><%= attribute_separator %><%= match.round %><%= attribute_separator %><%= match.finished %><%= attribute_separator %><%= match.bout_number %><%= attribute_separator %><%= Weight.where("id = ?",match.weight_id).first.max if match.weight_id %><%= attribute_separator %><%= match.bracket_position %><%= attribute_separator %><%= match.bracket_position_number %><%= attribute_separator %><%= match.loser1_name %><%= attribute_separator %><%= match.loser2_name %><%= attribute_separator %><%= Mat.where("id = ?",match.mat_id).first.name if match.mat_id %><% end %> \ No newline at end of file