aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-07-28 14:24:56 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-07-28 14:24:56 -0500
commit79b87787213fe773f87ffb39c7a286ccaa5d4a1b (patch)
treefdbc984a89d4c93952abe154748ef3b15d04fea7 /activemodel
parentb8672914b746d3b29213a9b4b9252735f1c3ee5d (diff)
downloadrails-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.rb13
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