You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use custom class for pending migrations connection
In bensheldon/good_job#1103 it was reported that a connection not
established is being seen when there are multiple configs for an
environment (a multi-db app).
While I think that something is happening where Good Job is accessing
the connection while we're checking for pending migrations, this could
happen in other gems if we're clobbering the connection on
`ActiveRecord::Base` that is needed.
Here we are making a special class to establish connections to the
database. Because the class does not inherit from `Base` and establishes
it's own connection, it won't clobber any existing connections on
`Base`, leaving them in-tact while the app boots.
The reason this wasn't seen in 7.0 is because pending migrations didn't
check all the available configs. Once that was fixed this error
appeared.
I didn't add a test for this because it's really hard to reproduce
without good job and actually booting a server and running a request.
Fixes: rails#49689
0 commit comments