Contest language & top buttons
All checks were successful
CI / scan_ruby (push) Successful in 18s
CI / scan_js (push) Successful in 13s
CI / lint (push) Successful in 13s
CI / test (push) Successful in 33s

This commit is contained in:
sto
2025-06-20 08:07:39 +02:00
parent 71f2bb6b70
commit ac3b354480
13 changed files with 83 additions and 49 deletions

View File

@@ -4,6 +4,7 @@
#
# id :integer not null, primary key
# allow_registration :boolean default(FALSE)
# lang :string default("en")
# name :string
# slug :string
# team :boolean default(FALSE)
@@ -32,6 +33,7 @@ class Contest < ApplicationRecord
friendly_id :name, use: :slugged
validates :name, presence: true
validates :lang, inclusion: { in: Languages::AVAILABLE_LANGUAGES.map { |lang| lang[:id] } }
generates_token_for :token
end