Implement projected time
Some checks failed
CI / scan_ruby (push) Successful in 16s
CI / scan_js (push) Successful in 13s
CI / lint (push) Successful in 13s
CI / test (push) Failing after 35s

This commit is contained in:
sto
2025-11-14 12:13:09 +01:00
parent f91145637f
commit b88460ae71
16 changed files with 114 additions and 48 deletions

View File

@@ -0,0 +1,5 @@
class AddProjectedTimeToCompletion < ActiveRecord::Migration[8.0]
def change
add_column :completions, :projected_time, :integer
end
end

View File

@@ -0,0 +1,5 @@
class AddCompletionToOffline < ActiveRecord::Migration[8.0]
def change
add_reference :offlines, :completion, foreign_key: true
end
end

7
db/schema.rb generated
View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2025_11_14_085123) do
ActiveRecord::Schema[8.0].define(version: 2025_11_14_093213) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
@@ -67,6 +67,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_14_085123) do
t.integer "remaining_pieces"
t.integer "missing_pieces"
t.boolean "completed"
t.integer "projected_time"
t.index ["contest_id"], name: "index_completions_on_contest_id"
t.index ["contestant_id"], name: "index_completions_on_contestant_id"
t.index ["message_id"], name: "index_completions_on_message_id"
@@ -81,6 +82,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_14_085123) do
t.datetime "updated_at", null: false
t.string "display_time"
t.integer "time_seconds"
t.string "projected_time"
t.index ["contest_id"], name: "index_contestants_on_contest_id"
end
@@ -141,6 +143,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_14_085123) do
t.integer "missing_pieces"
t.integer "remaining_pieces"
t.boolean "submitted"
t.integer "completion_id"
t.index ["completion_id"], name: "index_offlines_on_completion_id"
t.index ["contest_id"], name: "index_offlines_on_contest_id"
t.index ["contestant_id"], name: "index_offlines_on_contestant_id"
end
@@ -185,6 +189,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_14_085123) do
add_foreign_key "contestants", "contests"
add_foreign_key "contests", "users"
add_foreign_key "messages", "contests"
add_foreign_key "offlines", "completions"
add_foreign_key "offlines", "contestants"
add_foreign_key "offlines", "contests"
add_foreign_key "puzzles", "contests"