Skip to content

Commit

Permalink
Remove deprecated AbstractController::Base::parent_prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Jan 4, 2015
1 parent 92e27d3 commit 34bcbcf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 35 deletions.
4 changes: 4 additions & 0 deletions actionview/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Remove deprecated `AbstractController::Base::parent_prefixes`.

*Rafael Mendonça França*

* Default translations that have a lower precedence than a html safe default,
but are not themselves safe, should not be marked as html_safe.

Expand Down
22 changes: 3 additions & 19 deletions actionview/lib/action_view/view_paths.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@ module ViewPaths
module ClassMethods
def _prefixes # :nodoc:
@_prefixes ||= begin
deprecated_prefixes = handle_deprecated_parent_prefixes
if deprecated_prefixes
deprecated_prefixes
else
return local_prefixes if superclass.abstract?

local_prefixes + superclass._prefixes
end
return local_prefixes if superclass.abstract?

local_prefixes + superclass._prefixes
end
end

Expand All @@ -34,17 +29,6 @@ def _prefixes # :nodoc:
def local_prefixes
[controller_path]
end

def handle_deprecated_parent_prefixes # TODO: remove in 4.3/5.0.
return unless respond_to?(:parent_prefixes)

ActiveSupport::Deprecation.warn(<<-MSG.squish)
Overriding `ActionController::Base::parent_prefixes` is deprecated,
override `.local_prefixes` instead.
MSG

local_prefixes + parent_prefixes
end
end

# The prefixes used in render "foo" shortcuts.
Expand Down
16 changes: 0 additions & 16 deletions actionview/test/actionpack/abstract/abstract_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,22 +182,6 @@ class OverridingLocalPrefixesTest < ActiveSupport::TestCase # TODO: remove me in
end
end

class DeprecatedParentPrefixes < OverridingLocalPrefixes
def self.parent_prefixes
["abstract_controller/testing/me3"]
end
end

class DeprecatedParentPrefixesTest < ActiveSupport::TestCase # TODO: remove me in 5.0/4.3.
test "overriding .parent_prefixes is deprecated" do
@controller = DeprecatedParentPrefixes.new
assert_deprecated do
@controller.process(:index)
end
assert_equal "Hello from me3/index.erb", @controller.response_body
end
end

# Test rendering with layouts
# ====
# self._layout is used when defined
Expand Down

0 comments on commit 34bcbcf

Please sign in to comment.