mongo_odm
mongo_odm copied to clipboard
Connection options get reset to default, when setting Mongo.config after Mongo class models are required
When a global ::MongoODM.config = {...} (e.g. outside of Rails) has been initialized, but after all the model classes are required, the connections always revert back to default settings, meaning the running code will use the default 'test' database. This results in hard to find bugs, as MongoODM.config still shows the correct database as set by the user, but the connection itself actually reverted back to 'test'. Fixed the issue by setting ::MongoODM.config = {...} before any model classes are required.
Thanks, I will check it and fix it.