Merge pull request #27858 from mtsmfm/fix-inherit-from-deprecated-erubis
Fix inherit from deprecated `ActionView::Template::Handlers::Erubis`
This commit is contained in:
commit
22f4392bb4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user