Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper loading of ActionController::Base causes initialization conflicts #142

Open
ricksuggs opened this issue Jan 9, 2024 · 0 comments

Comments

@ricksuggs
Copy link

Problem

The health_check gem causes ActionController::Base to be loaded too early in the Rails initialization process. This causes some initializers to be loaded after ActionController::Base is loaded, which in turn means that the configurations are not applied as expected.

For example, when a Rails app is upgraded from 6.1 to 7.0, a new_framework_defaults_7_0.rb is created to configure the new framework defaults for the new version one by one. (Source code)

One of these configurations is:

# Enable parameter wrapping for JSON.
# Previously this was set in an initializer. It's fine to keep using that initializer if you've customized it.
# To disable parameter wrapping entirely, set this config to `false`.
Rails.application.config.action_controller.wrap_parameters_by_default = true

If the health_check gem is included in the project, then setting this configuration to true has no effect.

This issue is describe in detail in this Github issue in the rails repo.

This section of the Rails documentation describes how to correctly load Rails modules in third party engines / libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant