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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user