Module: Mongoid::Clients::StorageOptions
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
ActiveSupport::Concern
|
|
Defined in: | lib/mongoid/clients/storage_options.rb |
Overview
Mixin module included into ::Mongoid::Document
which adds the ability to set the collection in which to store the document by default.
Instance Attribute Summary
-
#remembered_storage_options ⇒ Hash | nil
rw
Internal use only
Internal use only
Remembers the storage options that were active when the current object was instantiated/created.
Instance Method Summary
-
#remember_storage_options!
Internal use only
Internal use only
Saves the storage options from the current persistence context.
-
#storage_options ⇒ Hash
Internal use only
Internal use only
The storage options that apply to this record, consisting of both the class-level declared storage options (e.g.
DSL Calls
included
[ GitHub ]13 14 15
# File 'lib/mongoid/clients/storage_options.rb', line 13
included do class_attribute :, instance_accessor: false, default: end
Instance Attribute Details
#remembered_storage_options ⇒ Hash | nil
(rw)
This method is for internal use only.
Remembers the storage options that were active when the current object was instantiated/created.
# File 'lib/mongoid/clients/storage_options.rb', line 25
attr_accessor :
Instance Method Details
#remember_storage_options!
This method is for internal use only.
Saves the storage options from the current persistence context.
# File 'lib/mongoid/clients/storage_options.rb', line 41
def return if Mongoid.legacy_persistence_context_behavior opts = persistence_context. self. = opts if opts end
#storage_options ⇒ Hash
This method is for internal use only.
The storage options that apply to this record, consisting of both the class-level declared storage options (e.g. store_in) merged with any remembered storage options.
# File 'lib/mongoid/clients/storage_options.rb', line 34
def self.class. .merge( || {}) end