Essentially when you require delayed_job_active_record, since it has a class that inherits from ActiveRecord::Base, it causes the Rails class loader to initialize ActiveRecord which causes some parts of Rails to then not be configurable.
I was pointed to this guide which recommends using the on_load hooks of ActiveSupport:
ActiveSupport.on_load(:active_record) do
DEFINE Delayed::Backend::ActiveRecord::Job < ::ActiveRecord::Base here
end
This will cause the block to get loaded after Rails initializes ActiveRecord
Some additional context in this Rails issue.
Essentially when you require
delayed_job_active_record
, since it has a class that inherits fromActiveRecord::Base
, it causes the Rails class loader to initializeActiveRecord
which causes some parts of Rails to then not be configurable.I was pointed to this guide which recommends using the
on_load
hooks ofActiveSupport
:This will cause the block to get loaded after Rails initializes
ActiveRecord