Skip to content

Add multidb support#240

Open
beetlegius-somos wants to merge 2 commits into
gregnavis:masterfrom
beetlegius-somos:add-multidb-support
Open

Add multidb support#240
beetlegius-somos wants to merge 2 commits into
gregnavis:masterfrom
beetlegius-somos:add-multidb-support

Conversation

@beetlegius-somos

Copy link
Copy Markdown

This change adds a configurable root model class (base_class) for ActiveRecordDoctor::Runner and all detectors, so model discovery and database connection follow the same abstract class you use in the app (e.g. ApplicationRecord), including multi-database setups.

  • Runner accepts base_class: (default ActiveRecord::Base).
  • Detectors::Base uses that class for #connection and #models (descendants).
  • Rake tasks read ACTIVE_RECORD_DOCTOR_BASE_CLASS and pass it to the runner; the default env string for constantize is corrected to "ActiveRecord::Base".
  • Regression tests cover Runner, detectors, and Rake behavior; README documents the env var.

Also includes a prior commit constraining minitest < 6 because minitest-fork_executor still hooks Minitest.run_one_method, removed in Minitest 6.

- Pass base_class through Runner and Detectors::Base (connection + models)
- Rake task: ACTIVE_RECORD_DOCTOR_BASE_CLASS env, fix default for constantize
- Tests and README for multi-database / custom root usage

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant