From 9808cdfa03b41173b13e03469a0f456d0b975c95 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 14 Sep 2015 15:23:25 -0700 Subject: initialize `@renderer` to avoid ivar warnings --- actionpack/lib/action_controller/metal/rendering.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index d054450853..5055a88217 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -13,13 +13,20 @@ module ActionController RENDERER_LOCK = Mutex.new - # Returns a renderer class (inherited from ActionController::Renderer) + attr_writer :renderer + + # Returns a renderer instance (inherited from ActionController::Renderer) # for the controller. def renderer @renderer || RENDERER_LOCK.synchronize do @renderer ||= Renderer.for(self) end end + + def inherited(klass) + klass.renderer = nil + super + end end # Before processing, set the request formats in current controller formats. -- cgit v1.2.3