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

add example to ActiveModel::StrictValidationFailed [ci skip]

This commit is contained in:
Francesco Rodriguez 2012-07-28 14:24:56 -05:00
parent b8672914b7
commit 79b8778721

View file

@ -437,6 +437,19 @@ module ActiveModel
# Raised when a validation cannot be corrected by end users and are considered # Raised when a validation cannot be corrected by end users and are considered
# exceptional. # 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 class StrictValidationFailed < StandardError
end end
end end