Module: Mongoid::Sessions::Options::Threaded

Included in:
ClassMethods, Proxy
Defined in:
lib/mongoid/sessions/options.rb

Instance Method Summary collapse

Instance Method Details

#persistence_options(klass = self) ⇒ Hash

Get the persistence options for the current thread.

Examples:

Get the persistence options.

Threaded.persistence_options(Band)

Parameters:

  • klass (Class) (defaults to: self)

    The model class.

Returns:

  • (Hash)

    The current persistence options.

Since:

  • 4.0.0



51
52
53
# File 'lib/mongoid/sessions/options.rb', line 51

def persistence_options(klass = self)
  Thread.current["[mongoid][#{klass}]:persistence-options"]
end