Sha256: 3644e8c1f16e7bc0ec1e5c9f300b8844961503228b9895d9c5e77dada097f598
Contents?: true
Size: 649 Bytes
Versions: 35
Compression:
Stored size: 649 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Contexts #:nodoc: module Ids # Return documents based on an id search. Will handle if a single id has # been passed or mulitple ids. # # Example: # # context.id_criteria([1, 2, 3]) # # Returns: # # The single or multiple documents. def id_criteria(params) criteria.id(params) result = params.is_a?(Array) ? criteria.entries : one if Mongoid.raise_not_found_error raise Errors::DocumentNotFound.new(klass, params) if result.blank? end return result end end end end
Version data entries
35 entries across 35 versions & 7 rubygems