Sha256: 354104d25dec84db3d34c7567fd3f04adb5b0e9b4376f9a499af422c916a8007

Contents?: true

Size: 779 Bytes

Versions: 2

Compression:

Stored size: 779 Bytes

Contents

require 'mongoid/extensions/hash/criteria_helpers'
require 'mongoid/extensions/symbol/inflections'
require 'mongo_doc/matchers'
require 'mongo_doc/contexts'
require 'mongoid/criteria'

module MongoDoc
  module Criteria
    # Create a criteria for this +Document+ class
    #
    # <tt>Person.criteria</tt>
    def criteria
      Mongoid::Criteria.new(self)
    end

    delegate \
      :and,
      :any_in,
      :cache,
      :enslave,
      :excludes,
      :extras,
      :id,
      :in,
      :limit,
      :not_in,
      :offset,
      :only,
      :order_by,
      :page,
      :per_page,
      :skip,
      :where, :to => :criteria
  end
end

Hash.send(:include, Mongoid::Extensions::Hash::CriteriaHelpers)
Symbol.send(:include, Mongoid::Extensions::Symbol::Inflections)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongo_doc-0.3.1 lib/mongo_doc/criteria.rb
mongo_doc-0.3.0 lib/mongo_doc/criteria.rb