mirror of https://github.com/rails/rails
Require that `ActionView::Base` subclasses implement `#compiled_method_container`
This commit is contained in:
parent
cd0c99c991
commit
469c4ccad7
|
@ -1,3 +1,7 @@
|
|||
* Require that `ActionView::Base` subclasses implement `#compiled_method_container`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated support to pass an object that is not a `ActionView::LookupContext` as the first argument
|
||||
in `ActionView::Base#initialize`.
|
||||
|
||||
|
|
|
@ -250,15 +250,11 @@ module ActionView #:nodoc:
|
|||
end
|
||||
|
||||
def compiled_method_container
|
||||
if self.class == ActionView::Base
|
||||
ActiveSupport::Deprecation.warn <<~eowarn.squish
|
||||
ActionView::Base instances must implement `compiled_method_container`
|
||||
or use the class method `with_empty_template_cache` for constructing
|
||||
an ActionView::Base instance that has an empty cache.
|
||||
eowarn
|
||||
end
|
||||
|
||||
self.class
|
||||
raise NotImplementedError, <<~msg.squish
|
||||
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
|
||||
end
|
||||
|
||||
def in_rendering_context(options)
|
||||
|
|
|
@ -380,7 +380,7 @@ module RenderTestCases
|
|||
|
||||
def test_without_compiled_method_container_is_deprecated
|
||||
view = ActionView::Base.with_view_paths(ActionController::Base.view_paths)
|
||||
assert_deprecated("ActionView::Base instances must implement `compiled_method_container`") do
|
||||
assert_raises(NotImplementedError) do
|
||||
assert_equal "Hello world!", view.render(template: "test/hello_world")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -55,6 +55,8 @@ Please refer to the [Changelog][action-pack] for detailed changes.
|
|||
|
||||
### Removals
|
||||
|
||||
* Require that `ActionView::Base` subclasses implement `#compiled_method_container`.
|
||||
|
||||
* Remove deprecated support to pass an object that is not a `ActionView::LookupContext` as the first argument
|
||||
in `ActionView::Base#initialize`.
|
||||
|
||||
|
|
Loading…
Reference in New Issue