Compare commits
No commits in common. "ce5b729fef1cd8e6d25ce746cbc58b10ffa5f4a4" and "570e517c28a2c353cc48350ddf4a4185031883cc" have entirely different histories.
ce5b729fef
...
570e517c28
@ -1,58 +0,0 @@
|
|||||||
---
|
|
||||||
:position: before
|
|
||||||
:position_in_additional_file_patterns: before
|
|
||||||
:position_in_class: before
|
|
||||||
:position_in_factory: before
|
|
||||||
:position_in_fixture: before
|
|
||||||
:position_in_routes: before
|
|
||||||
:position_in_serializer: before
|
|
||||||
:position_in_test: before
|
|
||||||
:classified_sort: true
|
|
||||||
:exclude_controllers: true
|
|
||||||
:exclude_factories: false
|
|
||||||
:exclude_fixtures: false
|
|
||||||
:exclude_helpers: true
|
|
||||||
:exclude_scaffolds: true
|
|
||||||
:exclude_serializers: false
|
|
||||||
:exclude_sti_subclasses: false
|
|
||||||
:exclude_tests: false
|
|
||||||
:force: false
|
|
||||||
:format_markdown: false
|
|
||||||
:format_rdoc: false
|
|
||||||
:format_yard: false
|
|
||||||
:frozen: false
|
|
||||||
:ignore_model_sub_dir: false
|
|
||||||
:ignore_unknown_models: false
|
|
||||||
:include_version: false
|
|
||||||
:show_check_constraints: false
|
|
||||||
:show_complete_foreign_keys: false
|
|
||||||
:show_foreign_keys: true
|
|
||||||
:show_indexes: true
|
|
||||||
:simple_indexes: false
|
|
||||||
:sort: false
|
|
||||||
:timestamp: false
|
|
||||||
:trace: false
|
|
||||||
:with_comment: true
|
|
||||||
:with_column_comments: true
|
|
||||||
:with_table_comments: true
|
|
||||||
:active_admin: false
|
|
||||||
:command:
|
|
||||||
:debug: false
|
|
||||||
:hide_default_column_types: ''
|
|
||||||
:hide_limit_column_types: ''
|
|
||||||
:ignore_columns:
|
|
||||||
:ignore_routes:
|
|
||||||
:models: true
|
|
||||||
:routes: false
|
|
||||||
:skip_on_db_migrate: false
|
|
||||||
:target_action: :do_annotations
|
|
||||||
:wrapper:
|
|
||||||
:wrapper_close:
|
|
||||||
:wrapper_open:
|
|
||||||
:classes_default_to_s: []
|
|
||||||
:additional_file_patterns: []
|
|
||||||
:model_dir:
|
|
||||||
- app/models
|
|
||||||
:require: []
|
|
||||||
:root_dir:
|
|
||||||
- ''
|
|
2
Gemfile
2
Gemfile
@ -58,8 +58,6 @@ end
|
|||||||
group :development do
|
group :development do
|
||||||
# Use console on exceptions pages [https://github.com/rails/web-console]
|
# Use console on exceptions pages [https://github.com/rails/web-console]
|
||||||
gem "web-console"
|
gem "web-console"
|
||||||
|
|
||||||
gem "annotaterb"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
|
@ -74,7 +74,6 @@ GEM
|
|||||||
uri (>= 0.13.1)
|
uri (>= 0.13.1)
|
||||||
addressable (2.8.7)
|
addressable (2.8.7)
|
||||||
public_suffix (>= 2.0.2, < 7.0)
|
public_suffix (>= 2.0.2, < 7.0)
|
||||||
annotaterb (4.14.0)
|
|
||||||
ast (2.4.2)
|
ast (2.4.2)
|
||||||
autoprefixer-rails (10.4.19.0)
|
autoprefixer-rails (10.4.19.0)
|
||||||
execjs (~> 2)
|
execjs (~> 2)
|
||||||
@ -393,7 +392,6 @@ PLATFORMS
|
|||||||
x86_64-linux-musl
|
x86_64-linux-musl
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
annotaterb
|
|
||||||
bcrypt (~> 3.1.7)
|
bcrypt (~> 3.1.7)
|
||||||
bootsnap
|
bootsnap
|
||||||
bootstrap (~> 5.3.3)
|
bootstrap (~> 5.3.3)
|
||||||
|
@ -1,27 +1,3 @@
|
|||||||
# == 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
|
class Completion < ApplicationRecord
|
||||||
belongs_to :contest
|
belongs_to :contest
|
||||||
belongs_to :contestant
|
belongs_to :contestant
|
||||||
|
@ -1,23 +1,3 @@
|
|||||||
# == 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
|
class Contest < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
|
@ -1,22 +1,3 @@
|
|||||||
# == 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
|
class Contestant < ApplicationRecord
|
||||||
belongs_to :contest
|
belongs_to :contest
|
||||||
|
|
||||||
|
@ -1,22 +1,3 @@
|
|||||||
# == 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
|
class Puzzle < ApplicationRecord
|
||||||
belongs_to :contest
|
belongs_to :contest
|
||||||
|
|
||||||
|
@ -1,22 +1,3 @@
|
|||||||
# == 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
|
class Session < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,3 @@
|
|||||||
# == 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
|
class User < ApplicationRecord
|
||||||
has_many :contests, dependent: :destroy
|
has_many :contests, dependent: :destroy
|
||||||
has_many :sessions, dependent: :destroy
|
has_many :sessions, dependent: :destroy
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
class AddAdminToUser < ActiveRecord::Migration[8.0]
|
|
||||||
def change
|
|
||||||
add_column :users, :admin, :boolean, null: false, default: false
|
|
||||||
end
|
|
||||||
end
|
|
3
db/schema.rb
generated
3
db/schema.rb
generated
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[8.0].define(version: 2025_03_22_071308) do
|
ActiveRecord::Schema[8.0].define(version: 2025_03_20_093759) do
|
||||||
create_table "active_storage_attachments", force: :cascade do |t|
|
create_table "active_storage_attachments", force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.string "record_type", null: false
|
t.string "record_type", null: false
|
||||||
@ -94,7 +94,6 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_22_071308) do
|
|||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.string "username"
|
t.string "username"
|
||||||
t.boolean "admin", default: false, null: false
|
|
||||||
t.index ["email_address"], name: "index_users_on_email_address", unique: true
|
t.index ["email_address"], name: "index_users_on_email_address", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
# This rake task was added by annotate_rb gem.
|
|
||||||
|
|
||||||
# Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this
|
|
||||||
if Rails.env.development? && ENV["ANNOTATERB_SKIP_ON_DB_TASKS"].nil?
|
|
||||||
require "annotate_rb"
|
|
||||||
|
|
||||||
AnnotateRb::Core.load_rake_tasks
|
|
||||||
end
|
|
24
test/fixtures/completions.yml
vendored
24
test/fixtures/completions.yml
vendored
@ -1,29 +1,5 @@
|
|||||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
# == 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)
|
|
||||||
#
|
|
||||||
one:
|
one:
|
||||||
time_seconds: 1
|
time_seconds: 1
|
||||||
contestant: one
|
contestant: one
|
||||||
|
19
test/fixtures/contestants.yml
vendored
19
test/fixtures/contestants.yml
vendored
@ -1,24 +1,5 @@
|
|||||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
# == 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)
|
|
||||||
#
|
|
||||||
one:
|
one:
|
||||||
name: MyString
|
name: MyString
|
||||||
email: MyString
|
email: MyString
|
||||||
|
20
test/fixtures/contests.yml
vendored
20
test/fixtures/contests.yml
vendored
@ -1,25 +1,5 @@
|
|||||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
# == 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)
|
|
||||||
#
|
|
||||||
one:
|
one:
|
||||||
name: MyString
|
name: MyString
|
||||||
user: one
|
user: one
|
||||||
|
19
test/fixtures/puzzles.yml
vendored
19
test/fixtures/puzzles.yml
vendored
@ -1,24 +1,5 @@
|
|||||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
# == 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)
|
|
||||||
#
|
|
||||||
one:
|
one:
|
||||||
name: MyString
|
name: MyString
|
||||||
|
|
||||||
|
16
test/fixtures/users.yml
vendored
16
test/fixtures/users.yml
vendored
@ -1,21 +1,5 @@
|
|||||||
<% password_digest = BCrypt::Password.create("password") %>
|
<% password_digest = BCrypt::Password.create("password") %>
|
||||||
|
|
||||||
# == 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
|
|
||||||
#
|
|
||||||
one:
|
one:
|
||||||
email_address: one@example.com
|
email_address: one@example.com
|
||||||
password_digest: <%= password_digest %>
|
password_digest: <%= password_digest %>
|
||||||
|
@ -1,27 +1,3 @@
|
|||||||
# == 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)
|
|
||||||
#
|
|
||||||
require "test_helper"
|
require "test_helper"
|
||||||
|
|
||||||
class CompletionTest < ActiveSupport::TestCase
|
class CompletionTest < ActiveSupport::TestCase
|
||||||
|
@ -1,23 +1,3 @@
|
|||||||
# == 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)
|
|
||||||
#
|
|
||||||
require "test_helper"
|
require "test_helper"
|
||||||
|
|
||||||
class ContestTest < ActiveSupport::TestCase
|
class ContestTest < ActiveSupport::TestCase
|
||||||
|
@ -1,22 +1,3 @@
|
|||||||
# == 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)
|
|
||||||
#
|
|
||||||
require "test_helper"
|
require "test_helper"
|
||||||
|
|
||||||
class ContestantTest < ActiveSupport::TestCase
|
class ContestantTest < ActiveSupport::TestCase
|
||||||
|
@ -1,22 +1,3 @@
|
|||||||
# == 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)
|
|
||||||
#
|
|
||||||
require "test_helper"
|
require "test_helper"
|
||||||
|
|
||||||
class PuzzleTest < ActiveSupport::TestCase
|
class PuzzleTest < ActiveSupport::TestCase
|
||||||
|
@ -1,19 +1,3 @@
|
|||||||
# == 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
|
|
||||||
#
|
|
||||||
require "test_helper"
|
require "test_helper"
|
||||||
|
|
||||||
class UserTest < ActiveSupport::TestCase
|
class UserTest < ActiveSupport::TestCase
|
||||||
|
Loading…
x
Reference in New Issue
Block a user