Mark all translations that do not exist for destruction

When a translation not exists yet we can mark them all for destruction
by default. They already should be initialized correctly from database
or via nested attributes.
This commit is contained in:
Senén Rodero Rodríguez
2019-06-07 16:55:57 +02:00
parent 58164ee2ec
commit 966b5b19ba

View File

@@ -64,9 +64,7 @@ module TranslatableFormHelper
def new_translation_for(locale)
@object.translations.new(locale: locale).tap do |translation|
unless locale == I18n.locale && no_other_translations?(translation)
translation.mark_for_destruction
end
translation.mark_for_destruction
end
end