Methods

Class/Module Index [+]

Quicksearch

Mongoid::Errors::DocumentNotFound

Raised when querying the database for a document by a specific id which does not exist. If multiple ids were passed then it will display all of those.

@example Create the error.

DocumentNotFound.new(Person, ["1", "2"])

Attributes

identifiers[R]
klass[R]

Public Class Methods

new(klass, ids) click to toggle source
# File lib/mongoid/errors/document_not_found.rb, line 14
def initialize(klass, ids)
  @klass = klass
  @identifiers = ids.is_a?(Array) ? ids.join(", ") : ids

  super(
    translate(
      "document_not_found",
      { :klass => klass.name, :identifiers => identifiers }
    )
  )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.