From 363545aa20014c56f6da223acc4a46de5c873143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 14 Jan 2010 01:43:57 +0100 Subject: Different nested validations should not be ignore [#3638 status:resolved] --- activerecord/lib/active_record/autosave_association.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') 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) -- cgit v1.2.3