diff options
author | Łukasz Strzałkowski <lukasz.strzalkowski@gmail.com> | 2013-09-02 23:06:14 +0200 |
---|---|---|
committer | Łukasz Strzałkowski <lukasz.strzalkowski@gmail.com> | 2013-09-02 23:18:02 +0200 |
commit | 544d0fad3d76bd3077225c6afcb562197f240cb0 (patch) | |
tree | e21ed9bc1230900d401e1412ae86f24625942ea0 /actionpack | |
parent | 40fcb9e82220fe9a7a3b0b3aeee61f92f00942c2 (diff) | |
download | rails-544d0fad3d76bd3077225c6afcb562197f240cb0.tar.gz rails-544d0fad3d76bd3077225c6afcb562197f240cb0.tar.bz2 rails-544d0fad3d76bd3077225c6afcb562197f240cb0.zip |
Return to using protected_instance_variables in AV
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/abstract_controller/rendering.rb | 11 |
1 files changed, 6 insertions, 5 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 |