Add annotate_rb gem and annotate all models
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run

This commit is contained in:
sto
2025-03-22 08:39:40 +01:00
parent 884dbf40d9
commit ce5b729fef
20 changed files with 383 additions and 0 deletions

View File

@@ -1,3 +1,27 @@
# == Schema Information
#
# Table name: completions
#
# id :integer not null, primary key
# time_seconds :integer
# created_at :datetime not null
# updated_at :datetime not null
# contest_id :integer not null
# contestant_id :integer not null
# puzzle_id :integer not null
#
# Indexes
#
# index_completions_on_contest_id (contest_id)
# index_completions_on_contestant_id (contestant_id)
# index_completions_on_puzzle_id (puzzle_id)
#
# Foreign Keys
#
# contest_id (contest_id => contests.id)
# contestant_id (contestant_id => contestants.id)
# puzzle_id (puzzle_id => puzzles.id)
#
class Completion < ApplicationRecord
belongs_to :contest
belongs_to :contestant

View File

@@ -1,3 +1,23 @@
# == Schema Information
#
# Table name: contests
#
# id :integer not null, primary key
# allow_registration :boolean default(FALSE)
# name :string
# team :boolean default(FALSE)
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer not null
#
# Indexes
#
# index_contests_on_user_id (user_id)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
class Contest < ApplicationRecord
belongs_to :user

View File

@@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: contestants
#
# id :integer not null, primary key
# email :string
# name :string
# created_at :datetime not null
# updated_at :datetime not null
# contest_id :integer not null
#
# Indexes
#
# index_contestants_on_contest_id (contest_id)
#
# Foreign Keys
#
# contest_id (contest_id => contests.id)
#
class Contestant < ApplicationRecord
belongs_to :contest

View File

@@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: puzzles
#
# id :integer not null, primary key
# brand :string
# name :string
# created_at :datetime not null
# updated_at :datetime not null
# contest_id :integer not null
#
# Indexes
#
# index_puzzles_on_contest_id (contest_id)
#
# Foreign Keys
#
# contest_id (contest_id => contests.id)
#
class Puzzle < ApplicationRecord
belongs_to :contest

View File

@@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: sessions
#
# id :integer not null, primary key
# ip_address :string
# user_agent :string
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer not null
#
# Indexes
#
# index_sessions_on_user_id (user_id)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
class Session < ApplicationRecord
belongs_to :user
end

View File

@@ -1,3 +1,19 @@
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# admin :boolean default(FALSE), not null
# email_address :string not null
# password_digest :string not null
# username :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_users_on_email_address (email_address) UNIQUE
#
class User < ApplicationRecord
has_many :contests, dependent: :destroy
has_many :sessions, dependent: :destroy