diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-14 01:43:57 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-14 01:46:27 +0100 |
commit | 363545aa20014c56f6da223acc4a46de5c873143 (patch) | |
tree | 70c650fe783a3d2ca3f659bd89de88fa2607c999 /activerecord/lib/active_record | |
parent | 35933822dec7be3f895c7a3f1440d72c982aebdd (diff) | |
download | rails-363545aa20014c56f6da223acc4a46de5c873143.tar.gz rails-363545aa20014c56f6da223acc4a46de5c873143.tar.bz2 rails-363545aa20014c56f6da223acc4a46de5c873143.zip |
Different nested validations should not be ignore [#3638 status:resolved]
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/autosave_association.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index 7c4e81a617..e178cb4ef2 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -260,7 +260,8 @@ module ActiveRecord if reflection.options[:autosave] association.errors.each do |attribute, message| attribute = "#{reflection.name}.#{attribute}" - errors[attribute] << message if errors[attribute].empty? + errors[attribute] << message + errors[attribute].uniq! end else errors.add(reflection.name) |