Events: kickstart shared scoreboard
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
sto
2026-07-30 08:33:55 +02:00
parent b8a2e4b0b4
commit 4a4c79ad8a
13 changed files with 73 additions and 8 deletions

View File

@@ -6,6 +6,7 @@
# lang :string default("en")
# name :string
# shared_scoreboard :boolean
# slug :string
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer not null
@@ -19,8 +20,13 @@
# user_id (user_id => users.id)
#
class Event < ApplicationRecord
extend FriendlyId
belongs_to :user
has_many :contests, dependent: :destroy
friendly_id :name, use: :slugged
validates :name, presence: true
validates :lang, inclusion: { in: Languages::AVAILABLE_LANGUAGES.map { |lang| lang[:id] } }
end