aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorlulalala <mark@goodlife.tw>2018-04-03 13:06:04 +0800
committerlulalala <mark@goodlife.tw>2019-03-31 22:59:12 +0800
commit86620cc3aa8e2630bc8d934b1a86453276b9eee9 (patch)
treef9853d8b8b55469c8e0a9facca31c647337c23ea /activerecord/lib/active_record
parent2a06f13099b3344e93198728795209bc69501d4a (diff)
downloadrails-86620cc3aa8e2630bc8d934b1a86453276b9eee9.tar.gz
rails-86620cc3aa8e2630bc8d934b1a86453276b9eee9.tar.bz2
rails-86620cc3aa8e2630bc8d934b1a86453276b9eee9.zip
Allow errors to remove duplicates, and ensure cyclic associations w/ autosave duplicate errors can be removed
See SHA 7550f0a016ee6647aaa76c0c0ae30bebc3867288
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/autosave_association.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb
index 453c6e4c8c..e05b7cd6d2 100644
--- a/activerecord/lib/active_record/autosave_association.rb
+++ b/activerecord/lib/active_record/autosave_association.rb
@@ -491,9 +491,7 @@ module ActiveRecord
end
def _ensure_no_duplicate_errors
- errors.messages.each_key do |attribute|
- errors[attribute].uniq!
- end
+ errors.uniq!
end
end
end