From 544d0fad3d76bd3077225c6afcb562197f240cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Strza=C5=82kowski?= Date: Mon, 2 Sep 2013 23:06:14 +0200 Subject: [PATCH] Return to using protected_instance_variables in AV --- actionpack/lib/abstract_controller/rendering.rb | 11 ++++++----- actionview/lib/action_view/rendering.rb | 4 ---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 5a5c47eb3b..a3c45bacb7 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -18,10 +18,6 @@ module AbstractController self.protected_instance_variables = [] end - def default_protected_instance_vars - [:@_action_name, :@_response_body, :@_formats, :@_prefixes, :@_config] - end - # Raw rendering of a template to a string. # # It is similar to render, except that it does not @@ -52,6 +48,11 @@ module AbstractController def rendered_format end + DEFAULT_PROTECTED_INSTANCE_VARIABLES = %w( + @_action_name @_response_body @_formats @_prefixes @_config + @_view_context_class @_view_renderer @_lookup_context + ) + # This method should return a hash with assigns. # You can overwrite this configuration per controller. # :api: public @@ -59,7 +60,7 @@ module AbstractController hash = {} variables = instance_variables variables -= protected_instance_variables - variables -= default_protected_instance_vars + variables -= DEFAULT_PROTECTED_INSTANCE_VARIABLES variables.each { |name| hash[name[1..-1]] = instance_variable_get(name) } hash end diff --git a/actionview/lib/action_view/rendering.rb b/actionview/lib/action_view/rendering.rb index db9c4ef501..478ee361e0 100644 --- a/actionview/lib/action_view/rendering.rb +++ b/actionview/lib/action_view/rendering.rb @@ -109,10 +109,6 @@ module ActionView Mime[lookup_context.rendered_format] end - def default_protected_instance_vars - super.concat([:@_view_context_class, :@_view_renderer, :@_lookup_context]) - end - private # Normalize args and options.