mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Showing next bout number and mat on school show page
This commit is contained in:
@@ -34,6 +34,30 @@ class Wrestler < ActiveRecord::Base
|
||||
end
|
||||
points
|
||||
end
|
||||
|
||||
def nextMatch
|
||||
unfinishedMatches.first
|
||||
end
|
||||
|
||||
def nextMatchBoutNumber
|
||||
if nextMatch
|
||||
nextMatch.bout_number
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
def nextMatchMatName
|
||||
if nextMatch
|
||||
nextMatch.mat_assigned
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
def unfinishedMatches
|
||||
allMatches.select{|m| m.finished != 1}.sort_by{|m| m.bout_number}
|
||||
end
|
||||
|
||||
def resultByBout(bout)
|
||||
@match = allMatches.select{|m| m.bout_number == bout and m.finished == 1}
|
||||
|
||||
Reference in New Issue
Block a user