mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
tournament.total_rounds should return 0 if there are none
This commit is contained in:
@@ -46,7 +46,11 @@ class Tournament < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def total_rounds
|
||||
if self.matches.count > 0
|
||||
self.matches.sort_by{|m| m.round}.last.round
|
||||
else
|
||||
0
|
||||
end
|
||||
end
|
||||
|
||||
def assign_mats(mats_to_assign)
|
||||
|
||||
Reference in New Issue
Block a user