Merge pull request #27858 from mtsmfm/fix-inherit-from-deprecated-erubis

Fix inherit from deprecated `ActionView::Template::Handlers::Erubis`
This commit is contained in:
Rafael França 2017-01-31 15:43:46 -05:00 committed by GitHub
commit 22f4392bb4
3 changed files with 12 additions and 1 deletions

@ -1,7 +1,7 @@
module ActionView
class Template
module Handlers
Erubis = ActiveSupport::Deprecation::DeprecatedConstantProxy.new("Erubis", "ActionView::Template::Handlers::ERB::Erubis", message: "ActionView::Template::Handlers::Erubis is deprecated and will be removed from Rails 5.2. Switch to ActionView::Template::Handlers::ERB::Erubi instead.")
autoload :Erubis, "action_view/template/handlers/erb/deprecated_erubis"
class ERB
autoload :Erubi, "action_view/template/handlers/erb/erubi"

@ -0,0 +1,9 @@
::ActiveSupport::Deprecation.warn("ActionView::Template::Handlers::Erubis is deprecated and will be removed from Rails 5.2. Switch to ActionView::Template::Handlers::ERB::Erubi instead.")
module ActionView
class Template
module Handlers
Erubis = ERB::Erubis
end
end
end

@ -5,6 +5,8 @@ class DeprecatedErubisImplementationTest < ActionView::TestCase
test "Erubis implementation is deprecated" do
assert_deprecated "ActionView::Template::Handlers::Erubis is deprecated and will be removed from Rails 5.2. Switch to ActionView::Template::Handlers::ERB::Erubi instead." do
assert_equal "ActionView::Template::Handlers::ERB::Erubis", ActionView::Template::Handlers::Erubis.to_s
assert_nothing_raised { Class.new(ActionView::Template::Handlers::Erubis) }
end
end
end