Aggiunge i18n IT/EN/FR/DE/ES, pagine pubbliche squadre e UX archivio.
Il selettore lingua funziona sul web e sulle app native; su Android la preferenza è persistita e applicata al riavvio. Incluse anche eliminazione replay a scope e campi pagina pubblica squadra. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
class AddPublicPageFieldsToTeams < ActiveRecord::Migration[7.2]
|
||||
def up
|
||||
add_column :teams, :slug, :string
|
||||
add_column :teams, :roster_public, :boolean, default: false, null: false
|
||||
|
||||
Team.reset_column_information
|
||||
used = {}
|
||||
Team.find_each do |team|
|
||||
base = team.name.to_s.parameterize.presence || "squadra"
|
||||
slug = base
|
||||
n = 2
|
||||
while used[slug]
|
||||
slug = "#{base}-#{n}"
|
||||
n += 1
|
||||
end
|
||||
used[slug] = true
|
||||
team.update_columns(slug: slug)
|
||||
end
|
||||
|
||||
change_column_null :teams, :slug, false
|
||||
add_index :teams, :slug, unique: true
|
||||
end
|
||||
|
||||
def down
|
||||
remove_index :teams, :slug
|
||||
remove_column :teams, :roster_public
|
||||
remove_column :teams, :slug
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user