database_cleaner-active_record
database_cleaner-active_record copied to clipboard
Avoid accidental replacement of main DB model connections
After making this PR, I ran into another issue in multiple database usage, which may be related to #24 and #47. ~~I'll put more details in #97, the issue bound to this PR.~~ [EDITED on Mar 3: instead I posted another suggestion to #100, where this PR can be closed if it is approved.]
In short, this patch will:
- resolves the issue with the use of a
:truncation
strategy. - but be useless with the use of
:transaction
strategy due to the "another issue" above.
@etagwerker I checked if #97 is reproduced with the commit of the PR. The problem still remains.
As per I wrote above and commented here, I would rather suggest dropping support for the connection name in the :db option.