diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-20 04:01:10 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-20 04:01:10 +0000 |
commit | d19e8f412f3cbd32842f94cba11e5c1148dfd558 (patch) | |
tree | 2e58fd5e580d1479ba6cdf3a0ff9443319dcf752 /actionpack/lib/action_controller/filters.rb | |
parent | 324ece25e9c9fb13ce91e591d5c5fdd512a81bb0 (diff) | |
download | rails-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/filters.rb')
-rw-r--r-- | actionpack/lib/action_controller/filters.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/filters.rb b/actionpack/lib/action_controller/filters.rb index 0a6a648885..2b260b80d7 100644 --- a/actionpack/lib/action_controller/filters.rb +++ b/actionpack/lib/action_controller/filters.rb @@ -283,22 +283,22 @@ module ActionController #:nodoc: # Returns all the before filters for this class and all its ancestors. def before_filters #:nodoc: - read_inheritable_attribute("before_filters") || [] + @before_filters ||= read_inheritable_attribute("before_filters") || [] end # Returns all the after filters for this class and all its ancestors. def after_filters #:nodoc: - read_inheritable_attribute("after_filters") || [] + @after_filters ||= read_inheritable_attribute("after_filters") || [] end # Returns a mapping between filters and the actions that may run them. def included_actions #:nodoc: - read_inheritable_attribute("included_actions") || {} + @included_actions ||= read_inheritable_attribute("included_actions") || {} end # Returns a mapping between filters and actions that may not run them. def excluded_actions #:nodoc: - read_inheritable_attribute("excluded_actions") || {} + @excluded_actions ||= read_inheritable_attribute("excluded_actions") || {} end private |