aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorgbuesing <gbuesing@gmail.com>2008-04-20 21:57:56 -0500
committergbuesing <gbuesing@gmail.com>2008-04-20 21:57:56 -0500
commit6ef4239f8bd4d4ea7a5bc7f2cdaf14f87e6eb9a1 (patch)
tree54a76b1698a9012d5b37c3ee13d258c9a03beaa6 /actionpack/lib
parent32b82e4c6f5523cdf5ee78c3022c50b46e018351 (diff)
parent1d18651ea36e2ba274b6c2e0fd4edd425e028589 (diff)
downloadrails-6ef4239f8bd4d4ea7a5bc7f2cdaf14f87e6eb9a1.tar.gz
rails-6ef4239f8bd4d4ea7a5bc7f2cdaf14f87e6eb9a1.tar.bz2
rails-6ef4239f8bd4d4ea7a5bc7f2cdaf14f87e6eb9a1.zip
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-xactionpack/lib/action_controller/base.rb37
-rw-r--r--actionpack/lib/action_controller/caching/actions.rb5
2 files changed, 6 insertions, 36 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index c0f3122fbf..1aa027f9d7 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -253,16 +253,11 @@ module ActionController #:nodoc:
DEFAULT_RENDER_STATUS_CODE = "200 OK"
include StatusCodes
-
- # Determines whether the view has access to controller internals @request, @response, @session, and @template.
- # By default, it does.
- @@view_controller_internals = true
- cattr_accessor :view_controller_internals
-
- # Protected instance variable cache
- @@protected_variables_cache = nil
- cattr_accessor :protected_variables_cache
-
+
+ # Controller specific instance variables which will not be accessible inside views.
+ @@protected_view_variables = %w(@assigns @performed_redirect @performed_render @variables_added @request_origin @url @parent_controller
+ @action_name @before_filter_chain_aborted @action_cache_path)
+
# Prepends all the URL-generating helpers from AssetHelper. This makes it possible to easily move javascripts, stylesheets,
# and images to a dedicated asset server away from the main web server. Example:
# ActionController::Base.asset_host = "http://assets.example.com"
@@ -1194,7 +1189,6 @@ module ActionController #:nodoc:
def add_variables_to_assigns
unless @variables_added
add_instance_variables_to_assigns
- add_class_variables_to_assigns if view_controller_internals
@variables_added = true
end
end
@@ -1208,30 +1202,11 @@ module ActionController #:nodoc:
end
def add_instance_variables_to_assigns
- @@protected_variables_cache ||= Set.new(protected_instance_variables)
- instance_variable_names.each do |var|
- next if @@protected_variables_cache.include?(var)
+ (instance_variable_names - @@protected_view_variables).each do |var|
@assigns[var[1..-1]] = instance_variable_get(var)
end
end
- def add_class_variables_to_assigns
- %w(view_paths logger).each do |cvar|
- @assigns[cvar] = self.send(cvar)
- end
- end
-
- def protected_instance_variables
- if view_controller_internals
- %w(@assigns @performed_redirect @performed_render)
- else
- %w(@assigns @performed_redirect @performed_render
- @_request @request @_response @response @_params @params
- @_session @session @_cookies @cookies
- @template @request_origin @parent_controller)
- end
- end
-
def request_origin
# this *needs* to be cached!
# otherwise you'd get different results if calling it more than once
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb
index 4410e47eb3..7b0551c664 100644
--- a/actionpack/lib/action_controller/caching/actions.rb
+++ b/actionpack/lib/action_controller/caching/actions.rb
@@ -41,7 +41,6 @@ module ActionController #:nodoc:
base.extend(ClassMethods)
base.class_eval do
attr_accessor :rendered_action_cache, :action_cache_path
- alias_method_chain :protected_instance_variables, :action_caching
end
end
@@ -55,10 +54,6 @@ module ActionController #:nodoc:
end
protected
- def protected_instance_variables_with_action_caching
- protected_instance_variables_without_action_caching + %w(@action_cache_path)
- end
-
def expire_action(options = {})
return unless cache_configured?