Copy welcome_message translation override to welcome_message_invite_only (#6949)

This commit copies `login_required.welcome_message` translation override to `login_required.welcome_message_invite_only` if the `login_required.welcome_message_invite_only` override is blank. This is done so as to ensure that login page customization remains same after [this commit](93eb0a0690).
This commit is contained in:
Arpit Jalan 2019-01-28 13:59:21 +05:30 committed by GitHub
parent 7e4edcfae8
commit 244628ed98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,11 @@
class CopyLoginRequiredWelcomeMessage < ActiveRecord::Migration[5.2]
def change
execute <<~SQL
INSERT INTO translation_overrides (locale, translation_key, value, created_at, updated_at)
SELECT locale, 'login_required.welcome_message_invite_only', value, created_at, updated_at
FROM translation_overrides
WHERE translation_key = 'login_required.welcome_message'
AND NOT EXISTS (SELECT 1 FROM translation_overrides WHERE translation_key = 'login_required.welcome_message_invite_only');
SQL
end
end