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>
17 lines
387 B
Ruby
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
|