collectiveidea / delayed_job_active_record

ActiveRecord backend integration for DelayedJob 3.0+
MIT License
343 stars 337 forks source link

Deprecation warning in rails 7.1 #217

Closed bjer closed 11 months ago

bjer commented 11 months ago

Got a deprecation warning when updating an app to Rails 7.1:

 DEPRECATION WARNING: Calling `ActiveRecord::Base.clear_all_connections! is deprecated. 
Please call the method directly on the connection handler; for example: 
`ActiveRecord::Base.connection_handler.clear_all_connections!`. 
(called from before_fork at .rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/bundler/gems/delayed_job_active_record-6e8709f887fa/lib/delayed/backend/active_record.rb:65)
 (ActiveSupport::DeprecationException)

Fixed by changing call clear_all_connections! in active_record.rb:65

ghiculescu commented 6 months ago

FYI to anyone else - this was fixed in https://github.com/collectiveidea/delayed_job_active_record/pull/218