Module: Mongoid::Clients::StorageOptions::ClassMethods
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/mongoid/clients/storage_options.rb
Instance Method Summary collapse
-
#client_name ⇒ Symbol
(also: #session_name)
Get the client name for the model.
-
#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.
-
#storage_options_defaults ⇒ Hash
Get the default storage options.
-
#store_in(options) ⇒ Class
Give this model specific custom default storage options.
Instance Method Details
#client_name ⇒ Symbol Also known as: session_name
Get the client name for the model.
103 104 105 |
# File 'lib/mongoid/clients/storage_options.rb', line 103 def client_name __evaluate__([:client]) end |
#collection_name ⇒ Symbol
Get the name of the collection this model persists to.
91 92 93 |
# File 'lib/mongoid/clients/storage_options.rb', line 91 def collection_name __evaluate__([:collection]) end |
#database_name ⇒ Symbol
Get the database name for the model.
117 118 119 |
# File 'lib/mongoid/clients/storage_options.rb', line 117 def database_name __evaluate__([:database]) end |
#reset_storage_options! ⇒ Object
Reset the store_in options
63 64 65 |
# File 'lib/mongoid/clients/storage_options.rb', line 63 def self. = .dup end |
#storage_options_defaults ⇒ Hash
Get the default storage options.
75 76 77 78 79 80 81 |
# File 'lib/mongoid/clients/storage_options.rb', line 75 def { collection: name.collectionize.to_sym, client: :default, database: -> { configured_database } } end |
#store_in(options) ⇒ Class
Give this model specific custom default storage options.
52 53 54 55 |
# File 'lib/mongoid/clients/storage_options.rb', line 52 def store_in() Validators::Storage.validate(self, ) .merge!() end |