Skip to content

Commit df89774

Browse files
author
Stefano Verna
committed
1 parent ae20426 commit df89774

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/active_admin/globalize3/form_builder_extension.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def translated_inputs(name = "Translations", &block)
1313
end.join.html_safe
1414
end <<
1515
I18n.available_locales.sort.map do |locale|
16-
translation = object.translations.find_or_initialize_by_locale(locale)
16+
translation = object.translations.find { |t| t.locale.to_s == locale.to_s }
17+
translation ||= object.translations.build(locale: locale)
1718
fields = proc do |form|
1819
form.input(:locale, as: :hidden)
1920
form.input(:id, as: :hidden)

0 commit comments

Comments
 (0)