Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't save! each translation because that raises an exception and can…

…cels saving the rest which makes validations passed in the translation class extension not work as expected.
  • Loading branch information...
commit 20a81bc73061afd4964920f0979e1360acdc2c9a 1 parent 0d6d8d6
@gtd gtd authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/globalize/active_record/adapter.rb
View
2  lib/globalize/active_record/adapter.rb
@@ -30,7 +30,7 @@ def build_translations(save_translations = false)
stash.each do |locale, attrs|
translation = record.translations.detect{ |t| locale == t.locale } || record.translations.build(:locale => locale.to_s)
attrs.each { |attr_name, value| translation[attr_name] = value }
- translation.save! if save_translations
+ translation.save if save_translations
end
stash.clear if save_translations
end
Please sign in to comment.
Something went wrong with that request. Please try again.