diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/rendering.rb | 14 |
2 files changed, 6 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 0727bb8369..04e5922ce8 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -248,6 +248,7 @@ module ActionController MODULES.each do |mod| include mod end + setup_renderer! # Define some internal variables that should not be propagated to the view. PROTECTED_IVARS = AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES + [ diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index 5055a88217..00b551af94 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -11,20 +11,16 @@ module ActionController # Documentation at ActionController::Renderer#render delegate :render, to: :renderer - RENDERER_LOCK = Mutex.new - - 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 + attr_reader :renderer + + def setup_renderer! # :nodoc: + @renderer = Renderer.for(self) end def inherited(klass) - klass.renderer = nil + klass.setup_renderer! super end end |