aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/components.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-03-20 04:01:10 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-03-20 04:01:10 +0000
commitd19e8f412f3cbd32842f94cba11e5c1148dfd558 (patch)
tree2e58fd5e580d1479ba6cdf3a0ff9443319dcf752 /actionpack/lib/action_controller/components.rb
parent324ece25e9c9fb13ce91e591d5c5fdd512a81bb0 (diff)
downloadrails-d19e8f412f3cbd32842f94cba11e5c1148dfd558.tar.gz
rails-d19e8f412f3cbd32842f94cba11e5c1148dfd558.tar.bz2
rails-d19e8f412f3cbd32842f94cba11e5c1148dfd558.zip
Performance speedup for ActionController (closes #4174) [Stefan Kaes] Includes caching of filter chains -- be on the lookout for problems with that!
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3989 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/components.rb')
-rw-r--r--actionpack/lib/action_controller/components.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/components.rb b/actionpack/lib/action_controller/components.rb
index 3ea83463e3..cc57574f08 100644
--- a/actionpack/lib/action_controller/components.rb
+++ b/actionpack/lib/action_controller/components.rb
@@ -44,7 +44,11 @@ module ActionController #:nodoc:
@controller.send(:render_component_as_string, options)
end
end
-
+
+ # If this controller was instantiated to process a component request,
+ # +parent_controller+ points to the instantiator of this controller.
+ base.send :attr_accessor, :parent_controller
+
base.class_eval do
alias_method :process_cleanup_without_components, :process_cleanup
alias_method :process_cleanup, :process_cleanup_with_components
@@ -54,11 +58,9 @@ module ActionController #:nodoc:
alias_method :flash_without_components, :flash
alias_method :flash, :flash_with_components
+
+ alias_method :component_request?, :parent_controller
end
-
- # If this controller was instantiated to process a component request,
- # +parent_controller+ points to the instantiator of this controller.
- base.send :attr_accessor, :parent_controller
end
module ClassMethods
@@ -171,10 +173,6 @@ module ActionController #:nodoc:
yield
end
end
-
- def component_request?
- !@parent_controller.nil?
- end
def set_session_options_with_components(request)
set_session_options_without_components(request) unless component_request?