Module: Mongoid::Sessions::Options
Defined Under Namespace
Modules: ClassMethods, Threaded
Classes: Proxy
Instance Method Summary
collapse
Instance Method Details
#collection_name ⇒ Object
47
48
49
50
51
|
# File 'lib/mongoid/sessions/options.rb', line 47
def collection_name
if persistence_options && v = persistence_options[:collection]
return v.to_sym
end
end
|
#mongo_session ⇒ Object
40
41
42
43
44
45
|
# File 'lib/mongoid/sessions/options.rb', line 40
def mongo_session
if persistence_options
session_name = persistence_options[:session] || self.class.session_name
Sessions.with_name(session_name).with(persistence_options)
end
end
|
#persistence_options ⇒ Object
36
37
38
|
# File 'lib/mongoid/sessions/options.rb', line 36
def persistence_options
@persistence_options
end
|
#with(options) ⇒ Document
Tell the next persistance operation to store in a specific collection, database or session.
31
32
33
34
|
# File 'lib/mongoid/sessions/options.rb', line 31
def with(options)
@persistence_options = options
self
end
|