Refactor #13409
closedRemove maintain_test_schema! Rails initializer
Description
The config/initializers/0_maintain_test_schema.rb initializer added in #7230 can potentially be removed with some further fixes.
It exists to initialise the test database before the main Rails app and models are initialised, fixing a couple of bugs where loading the model requires the table to already be available. If the table isn't available then validators etc. aren't set up correctly and tests may fail. Removing the initialiser and the test DB, then running rake test
shows the issue. More info in #12873.
#13039 fixed one issue, but I think two further fixes are required:
1) validates_lengths_from_database needs to avoid reading DB information to set up its validators. https://github.com/rubiety/validates_lengths_from_database/pull/12 fixes this.
2) Our own validate_inclusion_in_families validator should not check for the attribute's existence - this check can probably be removed.