instance method
validate!
Ruby on Rails 7.2.3
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 413
def validate!(context = nil)
valid?(context) || raise_validation_error
end
Defined in activemodel/lib/active_model/validations.rb line 413
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Validations