From 7878027ca7de3dc13716f5efb088553fdd04d220 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Fri, 15 Feb 2019 15:48:55 +0900 Subject: Show deprecated message instead of raise exception in `compiled_method_container` method Since #35036, the subclasses of `ActionView::Base` requires the `compiled_method_container`. This is incompatible. For example, `web-console` use view class that subclass of `ActionView::Base`, and does not work it now cause of this. Actually, since it seems that it is only `ActionView::Base` that `compiled_method_container` is necessary, modified the condition that emits a warning. --- actionview/lib/action_view/base.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'actionview/lib/action_view') diff --git a/actionview/lib/action_view/base.rb b/actionview/lib/action_view/base.rb index 712e5d251e..c0d2d258c5 100644 --- a/actionview/lib/action_view/base.rb +++ b/actionview/lib/action_view/base.rb @@ -273,11 +273,15 @@ module ActionView #:nodoc: end def compiled_method_container - raise NotImplementedError, <<~msg - Subclasses of ActionView::Base must implement `compiled_method_container` - or use the class method `with_empty_template_cache` for constructing - an ActionView::Base subclass that has an empty cache. - msg + if self.class == ActionView::Base + ActiveSupport::Deprecation.warn <<~eowarn + ActionView::Base instances must implement `compiled_method_container` + or use the class method `with_empty_template_cache` for constructing + an ActionView::Base instances that has an empty cache. + eowarn + end + + self.class end def in_context(options, locals) -- cgit v1.2.3