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

Allow nil when modifiying match wrestlers, allow nil when stating a match, fixed tournament navbar on wrestler edit, fixed tournament navbar on edit match wrestlers

This commit is contained in:
2022-01-24 21:54:50 +00:00
parent 7220ffe3c6
commit 58d088907a
7 changed files with 52 additions and 23 deletions

View File

@@ -28,6 +28,9 @@ class Match < ActiveRecord::Base
def score_validation
if finished == 1
if ! winner_id
errors.add(:winner_id, "cannot be blank")
end
if win_type == "Pin" and ! score.match(/^[0-5]?[0-9]:[0-5][0-9]/)
errors.add(:score, "needs to be in time format MM:SS when win type is Pin example: 1:23 or 10:03")
end