mongo_odm icon indicating copy to clipboard operation
mongo_odm copied to clipboard

Connection options get reset to default, when setting Mongo.config after Mongo class models are required

Open teejteej opened this issue 13 years ago • 1 comments

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.

teejteej avatar Apr 01 '11 08:04 teejteej

Thanks, I will check it and fix it.

carlosparamio avatar Apr 05 '11 16:04 carlosparamio