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

Refactored names of methods and some db column

This commit is contained in:
2018-11-13 14:14:48 +00:00
parent 93be525832
commit d67a8f2b42
44 changed files with 350 additions and 350 deletions

View File

@@ -6,21 +6,21 @@ class Mat < ActiveRecord::Base
before_destroy do
if tournament.matches.size > 0
tournament.resetMats
tournament.reset_mats
matsToAssign = tournament.mats.select{|m| m.id != self.id}
tournament.assignMats(matsToAssign)
tournament.assign_mats(matsToAssign)
end
end
after_create do
if tournament.matches.size > 0
tournament.resetMats
tournament.reset_mats
matsToAssign = tournament.mats
tournament.assignMats(matsToAssign)
tournament.assign_mats(matsToAssign)
end
end
def assignNextMatch
def assign_next_match
t_matches = tournament.matches.select{|m| m.mat_id == nil && m.finished != 1 && m.bout_number != nil}
if t_matches.size > 0
match = t_matches.sort_by{|m| m.bout_number}.first
@@ -29,7 +29,7 @@ class Mat < ActiveRecord::Base
end
end
def unfinishedMatches
def unfinished_matches
matches.select{|m| m.finished != 1}.sort_by{|m| m.bout_number}
end