Permalink
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...
1 parent 0d6d8d6 commit 20a81bc73061afd4964920f0979e1360acdc2c9a @gtd gtd committed May 11, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit 20a81bc

Please sign in to comment.