Method: Mongoid::Threaded#clear_session

Defined in:
lib/mongoid/threaded.rb

#clear_session(client: nil) ⇒ nil

Note:

For backward compatibility it is allowed to call this method without

Clear the cached session for this thread for a client.

specifying client parameter.

Parameters:

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

    The client to clear the session for.

Returns:

  • (nil)


431
432
433
# File 'lib/mongoid/threaded.rb', line 431

def clear_session(client: nil)
  sessions.delete(client)&.end_session
end