mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-11 07:56:28 +00:00
Fixed bug where wrestler deducted points were deducting twice from the team score
This commit is contained in:
@@ -53,9 +53,7 @@ class School < ActiveRecord::Base
|
|||||||
def total_points_scored_by_wrestlers
|
def total_points_scored_by_wrestlers
|
||||||
points = 0.0
|
points = 0.0
|
||||||
self.wrestlers.each do |w|
|
self.wrestlers.each do |w|
|
||||||
if w.extra != true
|
points = points + w.total_team_points
|
||||||
points = points + w.total_team_points
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
points
|
points
|
||||||
end
|
end
|
||||||
@@ -65,11 +63,6 @@ class School < ActiveRecord::Base
|
|||||||
deductedPoints.each do |d|
|
deductedPoints.each do |d|
|
||||||
points = points + d.points
|
points = points + d.points
|
||||||
end
|
end
|
||||||
self.wrestlers.each do |w|
|
|
||||||
w.deductedPoints.each do |d|
|
|
||||||
points = points + d.points
|
|
||||||
end
|
|
||||||
end
|
|
||||||
points
|
points
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user