From 08f852390a7a5cdb5cb545e14ed6b32b228db72e Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 13 Jul 2019 00:13:57 +0200 Subject: [PATCH] let the upgrading guide point to the autoloading guide for STIs [skip ci] --- guides/source/upgrading_ruby_on_rails.md | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index 7918ff1f1a..97ee4dcf25 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -197,20 +197,7 @@ All is good! All known use cases of `require_dependency` have been eliminated, you should grep the project and delete them. -In the case of STIs with a hierarchy of more than two levels, you can preload the leaves of the hierarchy in an initializer: - -```ruby -# config/initializers/preload_stis.rb - -# By preloading leaves, the hierarchy is loaded upwards following -# the references to superclasses in the class definitions. -sti_leaves = %w( - app/models/leaf1.rb - app/models/leaf2.rb - app/models/leaf3.rb -) -Rails.autoloaders.main.preload(sti_leaves) -``` +If your application has STIs, please check their section in the guide [Autoloading and Reloading Constants (Zeitwerk Mode)](autoloading_and_reloading_constants.html#single-table-inheritance). #### Qualified names in class and module definitions -- GitLab