1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib
eileencodes 095f1bfaa0
Refactor schema migration on connection
This method was jumping through extra hoops to find the name of the
class the connection is stored on when we can get it from the connection
itself. Since we already have the connection we don't need to loop through the
pools.

In addition, this was using the wrong class name. The class name for the
schema migration should come from the connection owner class, not from
the `db_config.name`. In this case, `db_config.name` is the name of the
configuration in the database.yml. Rails uses the class name to lookup
connections, not the db config name, so we should be consistent here.

While working on this I noticed that we were generating an extra schema
migration class for `ActiveRecord::Base`. Since `ActiveRecord::Base` can
and should use the default and we don't want to create a new one for
single db applications, we should skip creating this if the spec name is
`ActiveRecord::Base`. I added an additional test that ensures the class
generation is correct.
2020-03-09 09:59:36 -04:00
..
active_record Refactor schema migration on connection 2020-03-09 09:59:36 -04:00
arel Refactor invert predicate 2020-03-04 09:28:51 -05:00
rails/generators Deprecate spec_name and use name for configurations 2020-02-24 13:27:07 -05:00
active_record.rb Move advisory lock to it's own connection 2020-01-23 14:36:32 -05:00
arel.rb Fix unscope when an eq node which has no arel attribute 2020-02-27 18:43:56 +09:00