Files
MatchLiveTv/backend/app/controllers/concerns/branding_attachments.rb
Emiliano Frascaro 4083bc5dee 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>
2026-05-27 09:16:24 +02:00

17 lines
387 B
Ruby

module BrandingAttachments
extend ActiveSupport::Concern
private
def attach_branding_logo(record)
file = params.dig(:branding, :logo_file)
record.logo_file.attach(file) if file.present?
end
def normalize_hex_color(value, fallback)
v = value.to_s.strip
v = "##{v}" if v.match?(/\A[0-9A-Fa-f]{6}\z/)
v.match?(Brandable::HEX_COLOR) ? v : fallback
end
end