From d19e8f412f3cbd32842f94cba11e5c1148dfd558 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 20 Mar 2006 04:01:10 +0000 Subject: 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 --- actionpack/lib/action_controller/components.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'actionpack/lib/action_controller/components.rb') 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? -- cgit v1.2.3