-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid loading ActionView::Base during initialization (#1528)
* Force tests to fail if Rails frameworks load during initialization Couldn't see a clean way of running this inside of an actual TestCase test, so took the nuclear option & fail the entire suite. * Avoid loading ViewComponent::Base during initialization It forces ActionView::Base to load, which is against Rails' engine guidelines https://edgeguides.rubyonrails.org/engines.html#load-and-configuration-hooks * Update docs/CHANGELOG.md Co-authored-by: Joel Hawksley <joelhawksley@github.com> Co-authored-by: Joel Hawksley <joel@hawksley.org>
- Loading branch information
1 parent
7d1b344
commit 22dbe8f
Showing
5 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
test/sandbox/config/initializers/zzz_complete_initialization.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
# FRAMEWORK_LOAD_POINTS ought to be empty - we shouldn't have | ||
# autoloaded ActionView::Base during initialization, for example. | ||
FRAMEWORK_LOAD_POINTS.each do |framework, caller| | ||
warn "#{framework} loaded too soon, from:" | ||
warn caller | ||
exit 1 | ||
end |