Replies: 1 comment
-
Hi @asgerb , Programmatic configuration of Mongoid is described in https://www.mongodb.com/docs/mongoid/master/reference/configuration/#loading-mongoid-configuration ( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've implemented test parallelization in my app using this module to "fork" the database, following the example found in
ActiveRecord
:This worked fine so far, but I've been running into issues lately as I'm transitioning to running tests in containers.
Specifically the test suite would try to connect to
localhost:27017
no matter what values I would configure inmongoid.yml
. After some debugging I found out that issue stems from my use ofMongoid::Config.connect_to
, which changes the hosts tolocalhost:27017
.It would be great to make it either possible to pass in the hosts, or possibly to read the hosts from the config if possible? We could then fall back to
localhost:27017
if that fails. Would be open to make a PR following any guidance on which path to take.For anyone stumbling on this looking for a solution, here's my dirty hack to make it work:
Beta Was this translation helpful? Give feedback.
All reactions