aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-07-15 20:41:16 +0100
committerGitHub <noreply@github.com>2019-07-15 20:41:16 +0100
commit43c27e479a3a8a59064fd7bdb98909ff81a8b3bf (patch)
tree67f909af97e8a13d8a75635d10ca5e000627633d /activemodel/lib
parentbec7be880064c7b50ab9500c3b4fdb4296a8cd4a (diff)
parent4a8cf101485469194f56ff666b262bd8bb2a538e (diff)
downloadrails-43c27e479a3a8a59064fd7bdb98909ff81a8b3bf.tar.gz
rails-43c27e479a3a8a59064fd7bdb98909ff81a8b3bf.tar.bz2
rails-43c27e479a3a8a59064fd7bdb98909ff81a8b3bf.zip
Merge pull request #36654 from Edouard-chin/ec-errors-delete
Returns `nil` when `AM::Errors#delete` doesn't delete anything:
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/errors.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index 3de999308b..e9f92dba82 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -198,7 +198,7 @@ module ActiveModel
matches.each do |error|
@errors.delete(error)
end
- matches.map(&:message)
+ matches.map(&:message).presence
end
# When passed a symbol or a name of a method, returns an array of errors