module Jennifer::Model::Validation

Included Modules

Direct including types

Defined in:

jennifer/model/validation.cr

Instance Method Summary

Instance Method Detail

def errors : Errors #

Returns container with object's validation errors.


[View source]
def invalid? #

Returns whether #errors container has any error.

Doesn't trigger validation.


[View source]
def valid? #

Returns whether object is valid.

Each invocation of this method triggers validations from scratch. If you want to avoid this - use #invalid?.

User.new({age: -2}).valid?

[View source]
def validate!(skip = false) : Bool #

Invokes validation and callbacks.


[View source]