Fix ISO code for Canadian French (#26015)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
		
							
								
								
									
										21
									
								
								db/migrate/20240109103012_fix_canadian_french_locale.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								db/migrate/20240109103012_fix_canadian_french_locale.rb
									
									
									
									
									
										Normal 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
 | 
			
		||||
@@ -10,7 +10,7 @@
 | 
			
		||||
#
 | 
			
		||||
# It's strongly recommended that you check this file into your version control system.
 | 
			
		||||
 | 
			
		||||
ActiveRecord::Schema[7.1].define(version: 2023_12_22_100226) do
 | 
			
		||||
ActiveRecord::Schema[7.1].define(version: 2024_01_09_103012) do
 | 
			
		||||
  # These are extensions that must be enabled in order to support this database
 | 
			
		||||
  enable_extension "plpgsql"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user