From e302725751fc4bdb26aa3d28ca5d934ec21319f9 Mon Sep 17 00:00:00 2001 From: Jan Habermann Date: Thu, 18 Oct 2018 19:05:20 +0200 Subject: Improve the logic that detects non-autoloaded constants If you require `nokogiri` from `app/models/user.rb`, dependencies.rb does not mark `Nokogiri` as an autoloaded constant, as expected. But the logic to detect these non-autoloaded constants is incomplete. See the tests defined in the patch for some cases incorrectly handled. --- .../autoloading_fixtures/module_folder/nested_with_require.rb | 8 ++++++++ .../test/autoloading_fixtures/nested_with_require_parent.rb | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 activesupport/test/autoloading_fixtures/module_folder/nested_with_require.rb create mode 100644 activesupport/test/autoloading_fixtures/nested_with_require_parent.rb (limited to 'activesupport/test/autoloading_fixtures') diff --git a/activesupport/test/autoloading_fixtures/module_folder/nested_with_require.rb b/activesupport/test/autoloading_fixtures/module_folder/nested_with_require.rb new file mode 100644 index 0000000000..f9d6e675d7 --- /dev/null +++ b/activesupport/test/autoloading_fixtures/module_folder/nested_with_require.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require "dependencies/module_folder/lib_class" + +module ModuleFolder + class NestedWithRequire + end +end diff --git a/activesupport/test/autoloading_fixtures/nested_with_require_parent.rb b/activesupport/test/autoloading_fixtures/nested_with_require_parent.rb new file mode 100644 index 0000000000..e8fb321077 --- /dev/null +++ b/activesupport/test/autoloading_fixtures/nested_with_require_parent.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class NestedWithRequireParent + ModuleFolder::NestedWithRequire +end -- cgit v1.2.3