Module: Mongoid::Sessions::StorageOptions::ClassMethods
- Defined in:
- lib/mongoid/sessions/storage_options.rb
Instance Method Summary collapse
-
#collection_name ⇒ Symbol
Get the name of the collection this model persists to.
-
#database_name ⇒ Symbol
Get the database name for the model.
-
#reset_storage_options! ⇒ Object
Reset the store_in options.
-
#session_name ⇒ Symbol
Get the session name for the model.
-
#storage_options_defaults ⇒ Hash
Get the default storage options.
-
#store_in(options) ⇒ Class
Give this model specific custom default storage options.
Instance Method Details
#collection_name ⇒ Symbol
Get the name of the collection this model persists to.
90 91 92 |
# File 'lib/mongoid/sessions/storage_options.rb', line 90 def collection_name __evaluate__([:collection]) end |
#database_name ⇒ Symbol
Get the database name for the model.
114 115 116 |
# File 'lib/mongoid/sessions/storage_options.rb', line 114 def database_name __evaluate__([:database]) end |
#reset_storage_options! ⇒ Object
Reset the store_in options
62 63 64 |
# File 'lib/mongoid/sessions/storage_options.rb', line 62 def self. = .dup end |
#session_name ⇒ Symbol
Get the session name for the model.
102 103 104 |
# File 'lib/mongoid/sessions/storage_options.rb', line 102 def session_name __evaluate__([:session]) end |
#storage_options_defaults ⇒ Hash
Get the default storage options.
74 75 76 77 78 79 80 |
# File 'lib/mongoid/sessions/storage_options.rb', line 74 def { collection: name.collectionize.to_sym, session: :default, database: -> { Mongoid.sessions[session_name][:database] } } end |
#store_in(options) ⇒ Class
Give this model specific custom default storage options.
51 52 53 54 |
# File 'lib/mongoid/sessions/storage_options.rb', line 51 def store_in() Validators::Storage.validate(self, ) .merge!() end |