Skip to content

Commit 34bcbcf

Browse files
committed
Remove deprecated AbstractController::Base::parent_prefixes
1 parent 92e27d3 commit 34bcbcf

File tree

3 files changed

+7
-35
lines changed

3 files changed

+7
-35
lines changed

actionview/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove deprecated `AbstractController::Base::parent_prefixes`.
2+
3+
*Rafael Mendonça França*
4+
15
* Default translations that have a lower precedence than a html safe default,
26
but are not themselves safe, should not be marked as html_safe.
37

actionview/lib/action_view/view_paths.rb

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@ module ViewPaths
1616
module ClassMethods
1717
def _prefixes # :nodoc:
1818
@_prefixes ||= begin
19-
deprecated_prefixes = handle_deprecated_parent_prefixes
20-
if deprecated_prefixes
21-
deprecated_prefixes
22-
else
23-
return local_prefixes if superclass.abstract?
24-
25-
local_prefixes + superclass._prefixes
26-
end
19+
return local_prefixes if superclass.abstract?
20+
21+
local_prefixes + superclass._prefixes
2722
end
2823
end
2924

@@ -34,17 +29,6 @@ def _prefixes # :nodoc:
3429
def local_prefixes
3530
[controller_path]
3631
end
37-
38-
def handle_deprecated_parent_prefixes # TODO: remove in 4.3/5.0.
39-
return unless respond_to?(:parent_prefixes)
40-
41-
ActiveSupport::Deprecation.warn(<<-MSG.squish)
42-
Overriding `ActionController::Base::parent_prefixes` is deprecated,
43-
override `.local_prefixes` instead.
44-
MSG
45-
46-
local_prefixes + parent_prefixes
47-
end
4832
end
4933

5034
# The prefixes used in render "foo" shortcuts.

actionview/test/actionpack/abstract/abstract_controller_test.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -182,22 +182,6 @@ class OverridingLocalPrefixesTest < ActiveSupport::TestCase # TODO: remove me in
182182
end
183183
end
184184

185-
class DeprecatedParentPrefixes < OverridingLocalPrefixes
186-
def self.parent_prefixes
187-
["abstract_controller/testing/me3"]
188-
end
189-
end
190-
191-
class DeprecatedParentPrefixesTest < ActiveSupport::TestCase # TODO: remove me in 5.0/4.3.
192-
test "overriding .parent_prefixes is deprecated" do
193-
@controller = DeprecatedParentPrefixes.new
194-
assert_deprecated do
195-
@controller.process(:index)
196-
end
197-
assert_equal "Hello from me3/index.erb", @controller.response_body
198-
end
199-
end
200-
201185
# Test rendering with layouts
202186
# ====
203187
# self._layout is used when defined

0 commit comments

Comments
 (0)