aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorCliff Pruitt <cliff.pruitt@cliffpruitt.com>2019-02-19 19:15:55 -0500
committerCliff Pruitt <cliff.pruitt@cliffpruitt.com>2019-02-20 10:54:05 -0500
commit998ed7eb3e801d39326f36fd3b0c259fee2be0ec (patch)
tree4f5f5aad0735d3669b0d35f9b0c12c2bd2343085 /actionview
parent26d062b6a730fef608eb7d78450b7020b50b908e (diff)
downloadrails-998ed7eb3e801d39326f36fd3b0c259fee2be0ec.tar.gz
rails-998ed7eb3e801d39326f36fd3b0c259fee2be0ec.tar.bz2
rails-998ed7eb3e801d39326f36fd3b0c259fee2be0ec.zip
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.
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/base.rb2
-rw-r--r--actionview/test/template/render_test.rb4
2 files changed, 6 insertions, 0 deletions
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