Require contest durations, prefill end times for unfinished puzzles & allow to modify them
This commit is contained in:
@@ -44,7 +44,7 @@ class Contest < ApplicationRecord
|
||||
validates :name, presence: true
|
||||
validates :lang, inclusion: { in: Languages::AVAILABLE_LANGUAGES.map { |lang| lang[:id] } }
|
||||
validates :ranking_mode, inclusion: { in: Ranking::AVAILABLE_RANKING_MODES.map { |lang| lang[:id] } }
|
||||
validates :duration, format: { with: /\A(\d\d:\d\d|\d:\d\d)\z/ }, if: -> { duration.present? }
|
||||
validates :duration, presence: true, format: { with: /\A(\d\d:\d\d|\d:\d\d)\z/ }
|
||||
|
||||
generates_token_for :token
|
||||
|
||||
|
||||
Reference in New Issue
Block a user