discourse/db/migrate/20171213105921_replace_invite_mailer_translation_override.rb
Sam Saffron 30990006a9 DEV: enable frozen string literal on all files
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.

Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00

15 lines
724 B
Ruby

# frozen_string_literal: true
class ReplaceInviteMailerTranslationOverride < ActiveRecord::Migration[5.1]
def change
execute <<~SQL
UPDATE translation_overrides
SET value = replace(value, '%{invitee_name}', '%{inviter_name}')
WHERE translation_key IN ('invite_mailer.subject_template', 'invite_mailer.text_body_template',
'invite_forum_mailer.subject_template', 'invite_forum_mailer.text_body_template',
'custom_invite_mailer.subject_template', 'custom_invite_mailer.text_body_template',
'custom_invite_forum_mailer.subject_template', 'custom_invite_forum_mailer.text_body_template');
SQL
end
end