1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-29 02:12:59 +00:00

Cleaned up a bunch of shit. Depricated model methods and controller methods.

This commit is contained in:
2015-04-15 13:42:12 +00:00
parent 451e6911f8
commit 2b1618c69b
9 changed files with 45 additions and 51 deletions

25
app/models/boutgen.rb Normal file
View File

@@ -0,0 +1,25 @@
class Boutgen
def matchesByRound(round, matches)
@matches = matches.select {|m| m.round == round}
return @matches
end
def giveBout(matches)
@matches = matches.sort_by{|x|[x.weight_max]}
@matches.each_with_index do |m, i|
bout = m.round * 1000 + i
m.boutNumber = bout
end
return @matches
end
def assignBouts(matches)
@round = 1
until matchesByRound(@round, matches).blank? do
@matches = matchesByRound(@round, matches)
giveBout(@matches)
@round += 1
end
return matches
end
end