Follow up #33637 and #33770#33825
Conversation
6eda9a7 to
6fe2de1
Compare
See `ConnectionUrlResolver#database_from_path` in `activerecord/lib/active_record/connection_adapters/connection_specification.rb`
… the CHANGELOG Since rails#33770 `#configs_for` changed method signature and it isn't supposed to work with a passed block.
6fe2de1 to
ecf6f30
Compare
ecf6f30 to
2bdca99
Compare
eileencodes
left a comment
There was a problem hiding this comment.
Thanks for fixing the docs. I left 2 comments about changes that I'd like to be reverted.
Also fyi the APIs for multi-db stuff is a moving target and is going to evolve a lot over the next couple of months as I add more features. It might be better to wait to do a full audit of the docs when I'm done instead of constantly having to clean them up 😄
There was a problem hiding this comment.
Can you put both of these back? They are not there accidentally. I'll add a test showing why they both need to be there but the gist is if the first reverse isn't there a multi-db tier will return the last configs instead of the first configs (ie animals instead of primary) and the second one was just for parity with Rails 5.2 - that it will return the config hash in the order of the database.yml. This is for backwards compatibility and will be removed in 6.1.
There was a problem hiding this comment.
Can you undo the changes that allow non-strings? I don't want the configs_for api to accept symbols. Maybe I'll change my mind later on but this API is a WIP so I'd rather just make it relatively strict for now.
2bdca99 to
0a6aa42
Compare
|
@eileencodes Thank you for the review. I just removed |
Fix sqlite3 url config in "Configuring Rails Applications" guide
See
ConnectionUrlResolver#database_from_pathinactiverecord/lib/active_record/connection_adapters/connection_specification.rbFix explanation of
ActiveRecord::Base.configurations.configs_forin the CHANGELOGSince Part 3: Multi-db Improvements, identifying replica configurations #33770
#configs_forchanged method signature and it isn'tsupposed to work with a passed block.
Fix
ActiveRecord::DatabaseConfigurations's docsAllowActiveRecord::DatabaseConfigurations#configs_forreceive:env_nameandspec_nameas symbolRemove extrareverseinActiveRecord::DatabaseConfigurations#to_hr? @eileencodes