diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-07-09 12:38:59 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-07-14 10:11:53 -0700 |
commit | 2167f95d857224b88901c5fb4cda63c2e0756676 (patch) | |
tree | 90c4227fe600875e9b1d262e79a57bbd111e9a7a | |
parent | 30370227890dc950f1544b7b1040aa75e505f877 (diff) | |
download | rails-2167f95d857224b88901c5fb4cda63c2e0756676.tar.gz rails-2167f95d857224b88901c5fb4cda63c2e0756676.tar.bz2 rails-2167f95d857224b88901c5fb4cda63c2e0756676.zip |
Restore the more readable before_ and after_filters methods since they aren't called frequently
-rw-r--r-- | actionpack/lib/action_controller/filters.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/actionpack/lib/action_controller/filters.rb b/actionpack/lib/action_controller/filters.rb index fc63890d13..10dc0cc45b 100644 --- a/actionpack/lib/action_controller/filters.rb +++ b/actionpack/lib/action_controller/filters.rb @@ -569,21 +569,13 @@ module ActionController #:nodoc: # Returns all the before filters for this class and all its ancestors. # This method returns the actual filter that was assigned in the controller to maintain existing functionality. def before_filters #:nodoc: - filters = [] - filter_chain.each do |filter| - filters << filter.method if filter.before? - end - filters + filter_chain.select(&:before?).map(&:method) end # Returns all the after filters for this class and all its ancestors. # This method returns the actual filter that was assigned in the controller to maintain existing functionality. def after_filters #:nodoc: - filters = [] - filter_chain.each do |filter| - filters << filter.method if filter.after? - end - filters + filter_chain.select(&:after?).map(&:method) end end |