fix: remove stale has_many_inversing config for Rails 8.1.3 compatibility (#9)

Rails 8.1.3 removed the has_many_inversing= setter on ActiveRecord::Base
(the feature is now permanently enabled). However, the ActiveRecord railtie
still sets config.active_record.has_many_inversing and tries to apply it
via ActiveRecord::Base.send('has_many_inversing=', v), causing:

  NoMethodError: undefined method 'has_many_inversing=' for class ActiveRecord::Base

Fix: delete the key from config.active_record after load_defaults so the
railtie never tries to apply the removed setter.

Co-authored-by: Bob Develop <developbob50@gmail.com>
pull/639/head
devin-ai-integration[bot] 2 weeks ago committed by GitHub
parent 0298c2122b
commit f7a35364d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -19,6 +19,11 @@ module DocuSeal
class Application < Rails::Application
config.load_defaults 8.1
# Rails 8.1.3 removed the has_many_inversing= setter on ActiveRecord::Base
# (the feature is now permanently enabled), but load_defaults still sets it
# via the 7.0 framework defaults, causing NoMethodError at boot.
config.active_record.delete(:has_many_inversing) if config.active_record.respond_to?(:delete)
config.autoload_lib(ignore: %w[assets tasks puma])
config.active_storage.routes_prefix = ''

Loading…
Cancel
Save