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

Added date to tournament

This commit is contained in:
2015-12-30 18:48:49 +00:00
parent 6d21e8ebdf
commit c82d6d727b
12 changed files with 48 additions and 17 deletions

View File

@@ -9,7 +9,15 @@ class Tournament < ActiveRecord::Base
has_many :wrestlers, through: :weights
has_many :matches, dependent: :destroy
validates :date, presence: true
def daysUntil
time = (Date.today - self.date).to_i
if time < 0
time = time * -1
end
time
end
def resetSchoolScores
schools.update_all("score = 0.0")