Fix ISO code for Canadian French (#26015)

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
gunchleoc 2024-01-09 11:56:13 +01:00 committed by GitHub
parent 5dc634796a
commit 173953c23e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 41 additions and 9 deletions

View file

@ -0,0 +1,21 @@
# frozen_string_literal: true
class FixCanadianFrenchLocale < ActiveRecord::Migration[7.0]
class User < ApplicationRecord
# Dummy class, to make migration possible across version changes
end
disable_ddl_transaction!
def up
User.where(locale: 'fr-QC').in_batches do |users|
users.update_all(locale: 'fr-CA')
end
end
def down
User.where(locale: 'fr-CA').in_batches do |users|
users.update_all(locale: 'fr-QC')
end
end
end