sto 67d2ef41b3
All checks were successful
CI / scan_ruby (push) Successful in 17s
CI / scan_js (push) Successful in 12s
CI / lint (push) Successful in 14s
CI / test (push) Successful in 36s
Add indicator for processed messages
2025-06-18 18:42:04 +02:00

38 lines
935 B
Ruby

# == Schema Information
#
# Table name: contests
#
# id :integer not null, primary key
# allow_registration :boolean default(FALSE)
# name :string
# slug :string
# team :boolean default(FALSE)
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer not null
#
# Indexes
#
# index_contests_on_slug (slug) UNIQUE
# index_contests_on_user_id (user_id)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
class Contest < ApplicationRecord
extend FriendlyId
belongs_to :user
has_many :completions, dependent: :destroy
has_many :contestants, dependent: :destroy
has_many :puzzles, dependent: :destroy
has_many :messages, dependent: :destroy
friendly_id :name, use: :slugged
validates :name, presence: true
generates_token_for :token
end