diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index cfec71e34bc02..032abbf188f19 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,7 @@ +* Remove deprecated `Module#parent_name`, `Module#parent` and `Module#parents`. + + *Rafael Mendonça França* + * Remove deprecated `ActiveSupport::LoggerThreadSafeLevel#after_initialize`. *Rafael Mendonça França* diff --git a/activesupport/lib/active_support/core_ext/module/introspection.rb b/activesupport/lib/active_support/core_ext/module/introspection.rb index e45e3d3007ff4..7cdcab59b8a76 100644 --- a/activesupport/lib/active_support/core_ext/module/introspection.rb +++ b/activesupport/lib/active_support/core_ext/module/introspection.rb @@ -17,14 +17,6 @@ def module_parent_name end end - def parent_name - ActiveSupport::Deprecation.warn(<<-MSG.squish) - `Module#parent_name` has been renamed to `module_parent_name`. - `parent_name` is deprecated and will be removed in Rails 6.1. - MSG - module_parent_name - end - # Returns the module which contains this one according to its name. # # module M @@ -44,14 +36,6 @@ def module_parent module_parent_name ? ActiveSupport::Inflector.constantize(module_parent_name) : Object end - def parent - ActiveSupport::Deprecation.warn(<<-MSG.squish) - `Module#parent` has been renamed to `module_parent`. - `parent` is deprecated and will be removed in Rails 6.1. - MSG - module_parent - end - # Returns all the parents of this module according to its name, ordered from # nested outwards. The receiver is not contained within the result. # @@ -76,12 +60,4 @@ def module_parents parents << Object unless parents.include? Object parents end - - def parents - ActiveSupport::Deprecation.warn(<<-MSG.squish) - `Module#parents` has been renamed to `module_parents`. - `parents` is deprecated and will be removed in Rails 6.1. - MSG - module_parents - end end diff --git a/activesupport/test/core_ext/module/introspection_test.rb b/activesupport/test/core_ext/module/introspection_test.rb index f9f649ce8179c..8d1a742eb2936 100644 --- a/activesupport/test/core_ext/module/introspection_test.rb +++ b/activesupport/test/core_ext/module/introspection_test.rb @@ -26,32 +26,14 @@ def test_module_parent_name_when_frozen assert_equal "ParentA::B", ParentA::B::FrozenC.module_parent_name end - def test_parent_name - assert_deprecated do - assert_equal "ParentA", ParentA::B.parent_name - end - end - def test_module_parent assert_equal ParentA::B, ParentA::B::C.module_parent assert_equal ParentA, ParentA::B.module_parent assert_equal Object, ParentA.module_parent end - def test_parent - assert_deprecated do - assert_equal ParentA, ParentA::B.parent - end - end - def test_module_parents assert_equal [ParentA::B, ParentA, Object], ParentA::B::C.module_parents assert_equal [ParentA, Object], ParentA::B.module_parents end - - def test_parents - assert_deprecated do - assert_equal [ParentA, Object], ParentA::B.parents - end - end end diff --git a/guides/source/6_1_release_notes.md b/guides/source/6_1_release_notes.md index 94dee39b1a6f2..c60310cecefdb 100644 --- a/guides/source/6_1_release_notes.md +++ b/guides/source/6_1_release_notes.md @@ -290,6 +290,8 @@ Please refer to the [Changelog][active-support] for detailed changes. * Remove deprecated `ActiveSupport::LoggerThreadSafeLevel#after_initialize`. +* Remove deprecated `Module#parent_name`, `Module#parent` and `Module#parents`. + ### Deprecations ### Notable changes