1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Reference updated errors attribute names method in deprecation warning

This commit is contained in:
Adam Hess 2020-04-22 09:08:42 -07:00
parent d796193e2d
commit 096f2d1f83

View file

@ -271,7 +271,7 @@ module ActiveModel
# person.errors.messages # => {:name=>["cannot be nil", "must be specified"]}
# person.errors.keys # => [:name]
def keys
deprecation_removal_warning(:keys, "errors.map { |error| error.attribute }")
deprecation_removal_warning(:keys, "errors.attribute_names")
keys = @errors.map(&:attribute)
keys.uniq!
keys.freeze