-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
Currently, the result of the following...
class Band
include Mongoid::Document
store_in collection: "one"
store_in session: "two"
end
...will result in {{Band.storage_options ==
{ session: "two" }}}, losing the earlier configuration. This is a contrived example. In my case, I was including modules into the class which themselves made calls to #store_in; this made the issue much more difficult to track down.
I think the current functionality is not the expected result. This pull request merges configurations together, instead of replacing them entirely, so that the above example would produce {{Band.storage_options ==
{ collection: "one", session: "two" }}}. Later calls to #store_in still take precedence over earlier ones.