Module | DataMapper::Validations::Context |
In: |
lib/dm-validations/context.rb
|
Module with validation context functionality.
Contexts are implemented using a thread-local array-based stack.
Are there any contexts on the stack?
@return [Boolean]
true/false whether there are any contexts on the context stack
@api semipublic
Execute a block of code within a specific validation context
@param [Symbol] context
the context to execute the block of code within
@api semipublic
The (thread-local) validation context stack This allows object graphs to be saved within potentially nested contexts without having to pass the validation context throughout
@api private
The default validation context for this Resource. This Resource‘s default context can be overridden by implementing default_validation_context
@return [Symbol]
the current validation context from the context stack (if valid for this model), or :default
@api semipublic