include?(attribute)
public
Returns true if the error messages include an error for
the given key attribute, false otherwise.
person.errors.messages
person.errors.include?(:name)
person.errors.include?(:age)
# File activemodel/lib/active_model/errors.rb, line 202
def include?(attribute)
@errors.any? { |error|
error.match?(attribute.to_sym)
}
end