diff --git a/app/models/match.rb b/app/models/match.rb
index 9562f58..b1d59b8 100644
--- a/app/models/match.rb
+++ b/app/models/match.rb
@@ -2,13 +2,4 @@ class Match < ActiveRecord::Base
belongs_to :tournament
WIN_TYPES = ["Decision", "Major", "Tech Fall", "Pin", "Forfeit", "Injury Default", "Default", "DQ"]
-
- def w1_name
- Wrestler.find(self.w1).name
- end
-
- def w2_name
- Wrestler.find(self.w2).name
- end
-
end
diff --git a/app/models/tournament.rb b/app/models/tournament.rb
index b741c65..317b5b1 100644
--- a/app/models/tournament.rb
+++ b/app/models/tournament.rb
@@ -9,13 +9,12 @@ class Tournament < ActiveRecord::Base
def upcomingMatches
# @matches = generateMatchups
- if self.matches.nil?
- return self.matches
+ if self.matchups_array
+ return matchupHashesToObjects(self.matchups_array)
else
@matches = generateMatchups
- puts @matches.inspect
- saveMatchups(@matches)
- return @matches
+ saveMatchups(@matches)
+ return @matches
end
end
@@ -35,18 +34,8 @@ class Tournament < ActiveRecord::Base
end
def saveMatchups(matches)
- matches.each do |m|
- @match = Match.new
- @match.w1 = m.w1
- @match.w2 = m.w2
- @match.round = m.round
- @match.boutNumber = m.boutNumber
- @match.bracket_position = m.bracket_position
- @match.bracket_position_number = m.bracket_position_number
- @match.tournament_id = self.id
- puts @match.inspect
- @match.save
- end
+ self.matchups_array = matchupObjectsToHash(matches)
+ self.save
end
diff --git a/app/views/layouts/_cdn.html.erb b/app/views/layouts/_cdn.html.erb
index 01039df..53233c9 100644
--- a/app/views/layouts/_cdn.html.erb
+++ b/app/views/layouts/_cdn.html.erb
@@ -9,11 +9,5 @@
-
-
-
-
-
-
diff --git a/app/views/static_pages/all_brackets.html.erb b/app/views/static_pages/all_brackets.html.erb
index 8e712e6..fecebfc 100644
--- a/app/views/static_pages/all_brackets.html.erb
+++ b/app/views/static_pages/all_brackets.html.erb
@@ -3,26 +3,11 @@
#html, #body, #wrapper { width:100%; }
-
-
+
<%= link_to "Back to #{@tournament.name} weights", "/static_pages/weights?tournament=#{@tournament.id}" %>
-
-
-
-
-