From 998ed7eb3e801d39326f36fd3b0c259fee2be0ec Mon Sep 17 00:00:00 2001 From: Cliff Pruitt Date: Tue, 19 Feb 2019 19:15:55 -0500 Subject: Deprecate ActionView::PathSet as argument to ActionView::Base.new Currently, `ActionView::Base.new` will raise a `NotImplementedError` when given an instance of `ActionView::PathSet` on initialization. This commit prevents the raised error in favor of a deprecation warning. --- actionview/lib/action_view/base.rb | 2 ++ actionview/test/template/render_test.rb | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'actionview') diff --git a/actionview/lib/action_view/base.rb b/actionview/lib/action_view/base.rb index be2a662adc..22d1895560 100644 --- a/actionview/lib/action_view/base.rb +++ b/actionview/lib/action_view/base.rb @@ -213,6 +213,8 @@ module ActionView #:nodoc: context.lookup_context when Array ActionView::LookupContext.new(context) + when ActionView::PathSet + ActionView::LookupContext.new(context) when nil ActionView::LookupContext.new([]) else diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index ee8a110b44..1f6dbfc4a5 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -360,6 +360,10 @@ module RenderTestCases assert_deprecated do ActionView::Base.new ["/a"] end + + assert_deprecated do + ActionView::Base.new ActionView::PathSet.new ["/a"] + end end def test_without_compiled_method_container_is_deprecated -- cgit v1.2.3