Skip to content

Commit

Permalink
Remove deprecated Module#parent_name, Module#parent and `Module#p…
Browse files Browse the repository at this point in the history
…arents
  • Loading branch information
rafaelfranca committed Oct 30, 2020
1 parent e84af03 commit 167b415
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 42 deletions.
4 changes: 4 additions & 0 deletions 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*
Expand Down
24 changes: 0 additions & 24 deletions activesupport/lib/active_support/core_ext/module/introspection.rb
Expand Up @@ -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
Expand All @@ -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.
#
Expand All @@ -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
18 changes: 0 additions & 18 deletions activesupport/test/core_ext/module/introspection_test.rb
Expand Up @@ -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
2 changes: 2 additions & 0 deletions guides/source/6_1_release_notes.md
Expand Up @@ -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
Expand Down

0 comments on commit 167b415

Please sign in to comment.