Class Mongoid::Scope
In: lib/mongoid/scope.rb
Parent: Object

This module handles behaviour for defining scopes on classes.

Methods

extend   new  

Attributes

conditions  [R] 
extensions  [R] 

Public Class methods

Create the new Scope. If a block is passed in, this Scope will store the block for future calls to extend.

@example Create a new scope.

  Scope.new(:title => "Sir")

@param [ Hash ] conditions The scoping limitations.

Public Instance methods

Extend a supplied criteria.

@example Extend the criteria.

  scope.extend(criteria)

@param [ Criteria } criteria A mongoid criteria to extend.

@return [ Criteria ] The new criteria object.

[Validate]