diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-07-28 14:24:56 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-07-28 14:24:56 -0500 |
commit | 79b87787213fe773f87ffb39c7a286ccaa5d4a1b (patch) | |
tree | fdbc984a89d4c93952abe154748ef3b15d04fea7 /activemodel | |
parent | b8672914b746d3b29213a9b4b9252735f1c3ee5d (diff) | |
download | rails-79b87787213fe773f87ffb39c7a286ccaa5d4a1b.tar.gz rails-79b87787213fe773f87ffb39c7a286ccaa5d4a1b.tar.bz2 rails-79b87787213fe773f87ffb39c7a286ccaa5d4a1b.zip |
add example to ActiveModel::StrictValidationFailed [ci skip]
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/errors.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 4ed3462e7e..6089cb8525 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -437,6 +437,19 @@ module ActiveModel # 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 |