123456789_123456789_123456789_123456789_123456789_

Exception: ActiveModel::StrictValidationFailed

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, StandardError
Instance Chain:
self, StandardError
Inherits: StandardError
  • ::Object
Defined in: activemodel/lib/active_model/errors.rb

Overview

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