Defer including PdfHelper into ActionController::Base until it's loaded #790
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ActionController::Base is lazily loaded by Rails and we don't want to prematurely load it, otherwise it may be loaded before initialization runs, then any configuration set in initialization is not copied over to ActionController::Base.
For example, the new Rails 5.2 config for
Rails.application.config.action_controller.default_protect_from_forgery
is assigned in an initializer, but ActionController::Base was loaded too early by the railtie, prior to running the initializers, so the value set was never set on ActionController::Base itself, thus never triggering the default protection.Rails 3 is the first version where load hooks were introduced, and Rails 5.2 is the first version where an explicit hook for ActionController::Base was introduced.