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

Added when they last wrestled

This commit is contained in:
2015-12-17 13:06:42 +00:00
parent 90bf95cd11
commit ae056ec7f8
2 changed files with 3 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ class Wrestler < ActiveRecord::Base
before_create do
self.tournament.destroyAllMatches
end
def lastFinishedMatch
allMatches.select{|m| m.finished == 1}.sort_by{|m| m.bout_number}.last

View File

@@ -17,11 +17,11 @@
<th><%= @w1.name %> <select id="w1-color" onchange="changeW1Color(this)">
<option value="green">Green</option>
<option value="red">Red</option>
</select></th>
</select><br>Last Match: <%= if @w1.lastMatch != nil then time_ago_in_words(@w1.lastMatch.updated_at) end%></th>
<th><%= @w2.name %> <select id="w2-color" onchange="changeW2Color(this)">
<option value="red">Red</option>
<option value="green">Green</option>
</select></th>
</select><br>Last Match: <%= if @w2.lastMatch != nil then time_ago_in_words(@w2.lastMatch.updated_at) end%></th>
</tr>
</thead>
<tbody>