Method: Mongoid::Contextual::Memory#third!

Defined in:
lib/mongoid/contextual/memory.rb

#third!Document

Get the third document in the database for the criteria’s selector or raise an error if none is found.

Examples:

Get the third document.

context.third!

Returns:

  • The third document.

Raises:

  • raises when there are no documents to take.



420
421
422
# File 'lib/mongoid/contextual/memory.rb', line 420

def third!
  third || raise_document_not_found_error
end