Fix existing user records with now-renamed pt
locale (#12092)
Fix #12082
This commit is contained in:
parent
8386d9ec10
commit
b5be067c88
2 changed files with 36 additions and 1 deletions
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
|
Loading…
Add table
Add a link
Reference in a new issue