pat / combustion

Simple, elegant testing for Rails Engines
MIT License
707 stars 51 forks source link

Rails 7.0.0.alpha1 deprecation warning involving `connection_handlers` #120

Closed jrochkind closed 2 years ago

jrochkind commented 2 years ago

Beginning in Rails 7.0.0.alpha1, using combustion 1.3.3:

DEPRECATION WARNING: Using legacy connection handling is deprecated. Please set
`legacy_connection_handling` to `false` in your application.

The new connection handling does not support `connection_handlers`
getter and setter.

Read more about how to migrate at: https://guides.rubyonrails.org/active_record_multiple_databases.html#migrate-to-the-new-connection-handling
 (called from <top (required)> at /Users/jrochkind/code/attr_json/spec/spec_helper.rb:25)

I believe this is being triggered by combustion. My spec_helper.rb:25 is my Combustion.initialize! :all line.

Although I can't find a reference to connection_handlers in Combustion source code, not sure exactly what's triggering it, haven't debugged it to that level. I am thinking this should be reproducible on any Rails 7.0.0.alpha1/2 app?

Everything does appear to work despite the deprecation warning.

jrochkind commented 2 years ago

Ah, it may literally just be saying that it wants config.legacy_connection_handling to be explicitly set to false to avoid deprecations, and it wasn't? Maybe Combustion just has to do that for Rails 7? Not sure.

pat commented 2 years ago

This was a bug, fixed in 792a6890b5f27bde33f813550ea39d7c781260e2 - thanks for letting me know :)

jrochkind commented 2 years ago

@pat I'm still seeing this deprecation error in my logs, backtrace pointing to `Combustion.initialize! :all``, testing under Rails 7.0.0 with combustion 1.3.5.

Any ideas? I'm not sure, that commit does look like it should be setting legacy_connection_handling to false, very weird!

jrochkind commented 2 years ago

Aha. Somehow I'm not really using combustion 1.3.5 even though I should be. I'm using combustion 1.3.3 on my test run... Got to debug that ok!