module Marten::Core::Validation::Callbacks
Overview
Provides the ability to define validation callbacks.
This module provides the ability to define callbacks that are executed before and / or after running validation
rules for the validated objects. Two hooks are enabled by the use of this module: before_validation
callbacks
are executed before running validation rules while after_validation
callbacks are executed after running them.
Direct including types
Defined in:
marten/core/validation/callbacks.crMacro Summary
-
after_validation(*names)
Allows to do define callbacks that are called after running the registered validation rules.
-
before_validation(*names)
Allows to do define callbacks that are called before running the registered validation rules.
Macro Detail
Allows to do define callbacks that are called after running the registered validation rules.
Either one or multiple validation methods can be specified:
class MyClass
include Marten::Core::Validation
after_validation(:callback_1)
after_validation(:callback_2, :callback_3)
end
Allows to do define callbacks that are called before running the registered validation rules.
Either one or multiple validation methods can be specified:
class MyClass
include Marten::Core::Validation
before_validation(:callback_1)
before_validation(:callback_2, :callback_3)
end