1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-09 23:44:52 +00:00

Merge branch 'development'

This commit is contained in:
2017-01-18 09:56:32 -05:00
4 changed files with 21 additions and 9 deletions

View File

@@ -124,6 +124,14 @@ class Wrestler < ActiveRecord::Base
pool_matches = allMatches.select{|m| m.bracket_position == "Pool"} pool_matches = allMatches.select{|m| m.bracket_position == "Pool"}
pool_matches.select{|m| m.poolNumber == self.generatePoolNumber} pool_matches.select{|m| m.poolNumber == self.generatePoolNumber}
end end
def hasAPoolBye
if weight.poolRounds(allMatches) > poolMatches.size
return true
else
return false
end
end
def championshipAdvancementWins def championshipAdvancementWins
matchesWon.select{|m| m.bracket_position == "Quarter" or m.bracket_position == "Semis"} matchesWon.select{|m| m.bracket_position == "Quarter" or m.bracket_position == "Semis"}

View File

@@ -34,7 +34,11 @@ class CalculateWrestlerTeamScore
def poolPoints def poolPoints
if @tournament.tournament_type == "Pool to bracket" if @tournament.tournament_type == "Pool to bracket"
(@wrestler.poolWins.size * 2) if @wrestler.poolWins.size >= 1 and @wrestler.hasAPoolBye == true
((@wrestler.poolWins.size * 2) + 2)
else
(@wrestler.poolWins.size * 2)
end
else else
0 0
end end

View File

@@ -1,7 +1,7 @@
FROM ruby:2.3.0 FROM ruby:2.3.0
RUN apt-get update RUN apt-get clean && apt-get update
RUN apt-get -y upgrade RUN apt-get -y upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libssl-dev libyaml-dev libreadline-dev openssl curl git-core zlib1g-dev bison libxml2-dev libxslt1-dev libcurl4-openssl-dev libsqlite3-dev sqlite3 wget apache2 apt-transport-https nodejs nodejs-legacy npm mysql-client postfix RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libssl-dev libyaml-dev libreadline-dev openssl curl git-core zlib1g-dev bison libxml2-dev libxslt1-dev libcurl4-openssl-dev libsqlite3-dev sqlite3 wget apache2 apt-transport-https nodejs nodejs-legacy npm mysql-client postfix

View File

@@ -402,7 +402,7 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
wrestler1 = Wrestler.where("name = ?", "Guy2").first wrestler1 = Wrestler.where("name = ?", "Guy2").first
wrestler2 = Wrestler.where("name = ?", "Guy3").first wrestler2 = Wrestler.where("name = ?", "Guy3").first
#Won four in pool #Won four in pool
assert_equal 20, wrestler1.totalTeamPoints assert_equal 22, wrestler1.totalTeamPoints
#Won two in pool #Won two in pool
assert_equal 16, wrestler2.totalTeamPoints assert_equal 16, wrestler2.totalTeamPoints
end end
@@ -466,25 +466,25 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
test "bonus points major" do test "bonus points major" do
endMatchWithMajor(2002,"Guy2") endMatchWithMajor(2002,"Guy2")
wrestler1 = Wrestler.where("name = ?", "Guy2").first wrestler1 = Wrestler.where("name = ?", "Guy2").first
assert_equal 3, wrestler1.teamPointsEarned assert_equal 5, wrestler1.teamPointsEarned
end end
test "bonus points pin" do test "bonus points pin" do
endMatchWithPin(2002,"Guy2") endMatchWithPin(2002,"Guy2")
wrestler1 = Wrestler.where("name = ?", "Guy2").first wrestler1 = Wrestler.where("name = ?", "Guy2").first
assert_equal 4, wrestler1.teamPointsEarned assert_equal 6, wrestler1.teamPointsEarned
end end
test "bonus points tech fall" do test "bonus points tech fall" do
endMatchWithTech(2002,"Guy2") endMatchWithTech(2002,"Guy2")
wrestler1 = Wrestler.where("name = ?", "Guy2").first wrestler1 = Wrestler.where("name = ?", "Guy2").first
assert_equal 3.5, wrestler1.teamPointsEarned assert_equal 5.5, wrestler1.teamPointsEarned
end end
test "pool team points win" do test "pool team points win" do
endMatch(2002,"Guy2") endMatch(2002,"Guy2")
wrestler1 = Wrestler.where("name = ?", "Guy2").first wrestler1 = Wrestler.where("name = ?", "Guy2").first
assert_equal 2, wrestler1.teamPointsEarned assert_equal 4, wrestler1.teamPointsEarned
end end
test "advancement points fourPoolsToQuarter Quarter" do test "advancement points fourPoolsToQuarter Quarter" do
@@ -558,10 +558,10 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
test "Conso bracket wins are 1pt" do test "Conso bracket wins are 1pt" do
elevenManBracketToSemis elevenManBracketToSemis
assert_equal 5, Wrestler.where("name = ?", "Guy17").first.teamPointsEarned assert_equal 7, Wrestler.where("name = ?", "Guy17").first.teamPointsEarned
endMatch(5006,"Guy17") endMatch(5006,"Guy17")
assert_equal 9, Wrestler.where("name = ?", "Guy17").first.teamPointsEarned assert_equal 11, Wrestler.where("name = ?", "Guy17").first.teamPointsEarned
end end
test "One pool placement points" do test "One pool placement points" do