Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Return to using protected_instance_variables in AV

  • Loading branch information...
commit 544d0fad3d76bd3077225c6afcb562197f240cb0 1 parent 40fcb9e
@strzalek strzalek authored
View
11 actionpack/lib/abstract_controller/rendering.rb
@@ -18,10 +18,6 @@ module Rendering
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 @@ def render(*args, &block)
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 @@ def view_assigns
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
View
4 actionview/lib/action_view/rendering.rb
@@ -109,10 +109,6 @@ def rendered_format
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.
Please sign in to comment.
Something went wrong with that request. Please try again.