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

Fix ActiveModel::Errors#has_key? return value

This commit is contained in:
Adrien Coquio 2014-01-22 15:49:31 +01:00
parent 1c2c552703
commit b97035df64

View file

@ -94,7 +94,7 @@ module ActiveModel
# person.errors.include?(:name) # => true
# person.errors.include?(:age) # => false
def include?(attribute)
(v = messages[attribute]) && v.any?
messages[attribute].present?
end
# aliases include?
alias :has_key? :include?