mongoid/mongoid — pull request #2838 by sinisterchipmunk (2013-02-17 03:57:06+00:00)
Title: Merge options given to #store_in so that previous settings are not lost

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.