instance method
validate!
Ruby on Rails 8.0.4
Since v5.2.8.1Signature
validate!(context = nil)
Runs all the validations within the specified context. Returns true if no errors are found, raises ValidationError otherwise.
Validations with no :on option will run no matter the context. Validations with some :on option will only run in the specified context.
Parameters
-
contextopt = nil
Source
# File activemodel/lib/active_model/validations.rb, line 419
def validate!(context = nil)
valid?(context) || raise_validation_error
end
Defined in activemodel/lib/active_model/validations.rb line 419
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Validations