Fix existing user records with now-renamed pt
locale (#12092)
Fix #12082
This commit is contained in:
11
db/migrate/20191007013357_update_pt_locales.rb
Normal file
11
db/migrate/20191007013357_update_pt_locales.rb
Normal file
@ -0,0 +1,11 @@
|
||||
class UpdatePtLocales < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
User.where(locale: 'pt').in_batches.update_all(locale: 'pt-PT')
|
||||
end
|
||||
|
||||
def down
|
||||
User.where(locale: 'pt-PT').in_batches.update_all(locale: 'pt')
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user