Fix 500 in cancellazione partita con recording collegato.

Distruggendo la sessione ora si elimina anche il recording, evitando la violazione FK su recordings.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-11 08:09:34 +02:00
co-authored by Cursor
parent 5d4bd8544d
commit 2db6541c91
2 changed files with 38 additions and 1 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ class StreamSession < ApplicationRecord
has_many :attempted_concurrency_violations, class_name: "StreamConcurrencyViolation",
foreign_key: :attempted_session_id, dependent: :nullify, inverse_of: :attempted_session
has_one :score_state, dependent: :destroy
has_one :recording
has_one :recording, dependent: :destroy
has_many :device_states, dependent: :destroy
validates :platform, inclusion: { in: PLATFORMS }