提交 79b87787 编写于 作者: F Francesco Rodriguez

add example to ActiveModel::StrictValidationFailed [ci skip]

上级 b8672914
......@@ -437,6 +437,19 @@ def normalize_message(attribute, message, options)
# Raised when a validation cannot be corrected by end users and are considered
# exceptional.
#
# class Person
# include ActiveModel::Validations
#
# attr_accessor :name
#
# validates_presence_of :name, strict: true
# end
#
# person = Person.new
# person.name = nil
# person.valid?
# # => ActiveModel::StrictValidationFailed: Name can't be blank
class StrictValidationFailed < StandardError
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册