chinwagsocial/db/migrate/20240109103012_fix_canadian_french_locale.rb
gunchleoc 173953c23e
Fix ISO code for Canadian French (#26015)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2024-01-09 10:56:13 +00:00

21 lines
470 B
Ruby

# 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