c1a215a06b
The schema cache tests test the following scenarios: 1) The default case works (single db, primary spec name (dev is default to primary in 2-tier config), standard default schema cache filename) 2) Primary always wins over other entries 3) A custom schema cache filename works when set in the configuration 4) A custom schema cache filename works when set in the ENV Cases that don't work: 1) A non-primary database entry picks up a namespaced schema cache file This can't work currently because there's no way of knowing which cache we actually want. In this railtie we can only load ActiveRecord::Base's schema cache. If we grab the first config we risk loading a cache for another connection because order is not guaranteed. 2) Multi-db schema caches The reasons are similar to above. In addition we can't loop through the configs, establish a connection, and load the cache because we don't know what parent class to establish a connection to. In that case AR Base will always get the cache and it would cause the last one to win and therefore be loaded on the wrong connection. The real fix for these issues is to get rid of the railtie entirely, but for now we needed to set this back to what the behavior was before recent changes but with the ability to pass a custom key. Co-authored-by: Katrina Owen <kytrinyx@github.com> |
||
---|---|---|
.. | ||
application | ||
command | ||
commands | ||
configuration | ||
engine | ||
fixtures/lib | ||
generators | ||
isolation | ||
minitest | ||
railties | ||
test_unit | ||
abstract_unit.rb | ||
app_loader_test.rb | ||
backtrace_cleaner_test.rb | ||
code_statistics_calculator_test.rb | ||
code_statistics_test.rb | ||
console_helpers.rb | ||
engine_test.rb | ||
env_helpers.rb | ||
generators_test.rb | ||
initializable_test.rb | ||
json_params_parsing_test.rb | ||
path_generation_test.rb | ||
paths_test.rb | ||
rack_logger_test.rb | ||
rails_info_controller_test.rb | ||
rails_info_test.rb | ||
secrets_test.rb | ||
version_test.rb |