I am doing rails upgrade from 6.1 to 7.1(specifically 7.1.2).
I am using only database replicas in my database.yml file. I have added database_tasks: false in the configs.
Due to this, when I run bundle exec rails s it fails giving out following error:
Exiting
/Users/pjartarkar/.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/railtie.rb:151:in `block (3 levels) in <class:Railtie>': undefined method `name' for nil:NilClass (NoMethodError)
db_config.name,
This is happening because at this line it returns false and db_config is returned as nil value.
Yeah, I did go step by step.
I facing this in rails 7.x.
My understanding is that if you have database_tasks: false in any of the config, then that config is not loaded. But, if all the configs have this database_tasks: false in them, then none of the config will be loaded and will get nil as db_config value. Hence, I wonder if the scenario was considered in rails 7.x, where an app exists where all db configs have this database_tasks: false in them.