Module DataMapper::Model::Scope
In: lib/dm-core/model/scope.rb

Module with query scoping functionality.

Scopes are implemented using simple array based stack that is thread local. Default scope can be set on a per repository basis.

Scopes are merged as new queries are nested. It is also possible to get exclusive scope access using with_exclusive_scope

Methods

Public Instance methods

TODO: document @api private

Returns query on top of scope stack

@api private

Protected Instance methods

Pushes given query on top of scope stack and yields given block, then pops the stack. During block execution queries previously pushed onto the stack have no effect.

@api private

Pushes given query on top of the stack

@param [Hash, Query] Query to add to current scope nesting

@api private

[Validate]