Club come entità principale, branding e fix infrastruttura streaming.

Introduce clubs con abbonamento, branding Active Storage e flusso registrazione società; corregge healthcheck MediaMTX (immagine distroless) e allinea dominio produzione matchlivetv.it.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-27 09:16:24 +02:00
parent 471291b2c4
commit 4083bc5dee
53 changed files with 1120 additions and 197 deletions

View File

@@ -0,0 +1,27 @@
class Club < ApplicationRecord
include Brandable
has_many :club_memberships, dependent: :destroy
has_many :users, through: :club_memberships
has_many :teams, dependent: :destroy
has_one :subscription, dependent: :destroy
validates :name, presence: true
validates :sport, presence: true
validates :primary_color, presence: true
validates :secondary_color, presence: true
def owner
club_memberships.find_by(role: "owner")&.user
end
def owned_by?(user)
club_memberships.exists?(user: user, role: "owner")
end
private
def branding_parent
nil
end
end