OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/db/migrate/20190618115620_fix_availabl...

27 lines
543 B

class FixAvailableLanguages < ActiveRecord::Migration[5.2]
def up
Setting.available_languages = Setting.available_languages.map do |lang|
if lang == 'zh'
'zh-CN'
else
lang
end
end
User.where(language: 'zh').update_all(language: 'zh-CN')
end
def down
Setting.available_languages = Setting.available_languages.map do |lang|
if lang == 'zh-CN'
'zh'
else
lang
end
end
User.where(language: 'zh-CN').update_all(language: 'zh')
end
private
end