Method: Mongoid::Threaded#add_modified_document

Defined in:
lib/mongoid/threaded.rb

#add_modified_document(session, document) ⇒ Object

Store a reference to the document that was modified inside a transaction associated with the session.

Parameters:

  • session (Mongo::Session)

    Session in scope of which the document was modified.

  • document (Mongoid::Document)

    Mongoid document that was modified.



441
442
443
444
445
# File 'lib/mongoid/threaded.rb', line 441

def add_modified_document(session, document)
  return unless session&.in_transaction?

  modified_documents[session] << document
end