1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test
Katrina Owen 2c2ff8228e
Allow schema cache path to be defined in the config file
This updates the database tasks for dumping the Active Record schema cache as
well as clearing the schema cache file, allowing the path to be defined in the
database configuration YAML file.

As before, the value can also be defined in an ENV variable, though this would
not work for a multi-db application. If the value is specified neither in the
DB config, nor in the ENV, then the path will continue to be derived from the
DB config spec_name.

Note that in order to make this change cleaner I also moved a bit of logic
out of a rake task and into the DatabaseTasks class, for symmetry.

We have two rake tasks for the schema cache:

    $ rake db:schema:cache:dump
    $ rake db:schema:cache:clear

The cache:dump task was implemented in DatabaseTasks, but the
cache:clear one was not.

I also added some tests for the behavior that I was changing, since some of
the code paths weren't tested.
2020-01-23 08:18:23 -07:00
..
active_record/connection_adapters Deduplicate various Active Record schema cache structures 2019-06-03 13:31:42 +02:00
assets
cases Allow schema cache path to be defined in the config file 2020-01-23 08:18:23 -07:00
fixtures Allow AR::Enum definitions with boolean values 2019-12-24 07:05:42 -10:00
migrations Fix occurrences Fixnum|Bignum 2018-03-04 20:44:30 +02:00
models Avoid extraneous preloading when loading across has_one associations 2020-01-08 08:14:04 +13:00
schema Add scale support to ActiveRecord::Validations::NumericalityValidator 2020-01-13 11:00:22 -05:00
support Deprecate #remove_connection in favor of #remove_connection_pool 2020-01-21 16:49:20 -05:00
config.example.yml Respect ENV variables when finding DBs etc for the test suite 2019-02-06 01:20:06 +10:30
config.rb