Method: Mongoid::Threaded#set_session

Defined in:
lib/mongoid/threaded.rb

#set_session(session, client: nil) ⇒ Object

Note:

For backward compatibility it is allowed to call this method without

Cache a session for this thread for a client.

specifying ‘client` parameter.

Parameters:

  • session (Mongo::Session)

    The session to save.

  • client (Mongo::Client | nil) (defaults to: nil)

    The client to cache the session for.



401
402
403
# File 'lib/mongoid/threaded.rb', line 401

def set_session(session, client: nil)
  sessions[client] = session
end